Sameersetia Sameersetia - 1 year ago 48
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 Source

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

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