Sameersetia Sameersetia - 7 months ago 14
SQL Question

ORACLE PL/SQL:Regex to add a space between leading dots of a String in oracle

For example


  • (.aa) becomes (. aa)

  • (..agsb) becomes (.. agsb)


Answer

Building on @Albert's response, this method doesn't have the space problem:

select regexp_replace('..agsb', '(\.+)([^. ])', '\1 \2') as output
from dual;