Connecting Tech Pros Worldwide Forums | Help | Site Map

Using Regex in java

Newbie
 
Join Date: Jun 2008
Posts: 18
#1: Oct 6 '09
Hi All,

I have to find all the commas in a string except the one that comes inside double quotes and then replace this comma and double quotes with "|"

e.g. "Gaurav,jain",gaurav,jain has to be converted into
|Gaurav,jain|gaurav|jain

I have been suggested that regex is a better option for the same.
I have used regex before but only very simple one.

So, if anyone can help me in writing this expression it would be really helpful.

Thanks
Gaurav Jain

Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,168
#2: Oct 6 '09

re: Using Regex in java


It would help if you shared with us your initial stab at what you think the regex should look like and we can help you from there....

-Frinny
Reply