REGEXP_REPLACE - remove commas from string ONLY if not enclosed in ()'s
564484Jun 12 2008 — edited Oct 26 2009
I'm trying to use REGEXP_REPLACE to replace all commas from a string with one exception - they must NOT be enclosed in parentheses to be replaced.
Before String: 'a, b, c (a, b, c)'
After string: 'a b c (a, b, c)'
I know there must be a clean regular expression pattern that can do this - but I can't get my head around it. I've tried using the "[^\(.*,.*\)]" pattern - but it seems to treat the enclosed pattern as just a list of single characters to NOT match.
I know you regular expression experts probably could answer this in about 5 seconds - so I thought I would post this question...
thanks very much...