Search code examples
oracle-databaseregexp-replace

Replace spaces after a dot in the string


I want to write a query in Oracle to remove any spaces after any dot in the string. example :

select 'My name is Pramod. I am writing a query. Today is AUG 16TH.' from dual;

output requested is :

My name is Pramod.I am writing a query.Today is AUG 16TH.

Solution

  • this works too.

    select regexp_replace( 'Right.   As @Mathguy said. It won''t work.always' ,'(\.)([[:space:]]*)', '.' )  from dual;