Search code examples
sqlregexoracle-databaseregexp-replace

Regular Expression to not to match period (.) from text(only alpha) but from alphanumeric text


SELECT regexp_replace('FRAME  WINDOW MASTER. 160.055-44.9 ADULT Z68.41', '[^A-Z0-9%+/.+ '']', ' ') 
FROM DUAL;

The result i get is

FRAME  WINDOW MASTER. 160.055 44.9 ADULT

but i want the Result to be

FRAME WINDOW MASTER 160.055 44.9 ADULT ( master without period)


Solution

  • Would this do the trick?

    "[^A-Z0-9%+/.+ '']|\.\s"
    

    I'm not sure exactly what you want but it gives the output you want.

    Edit this is the fix:

    [^A-Z0-9%+/.+ '']|\.(\s|$)