Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Regular expression, replace all commas between double quotes ONLY

Minoo.LJun 9 2015 — edited Jun 10 2015

hi there,

i  want to remove all the commas between double quotes:

I tried below pattern , but it does not replace all  if we have more than one comma in double quote.

SELECT REGEXP_REPLACE('123,"45,6",Hello ,"John , Mike , Marc", 456, ,"Anne-,Anna"','"([^"]*),([^"]*)"','"\1;\2"',1,0) as result

FROM DUAL;

Result

--------------------------------------------------------------------------

123,"45;6",Hello ,"John , Mike ; Marc", 456, ,"Anne-;Anna"

the first comma between "John , Mike ; Marc" is not replaced...

This post has been answered by Etbin on Jun 10 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2015
Added on Jun 9 2015
17 comments
2,803 views