Using Regex in java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gjain12
    New Member
    • Jun 2008
    • 19

    Using Regex in java

    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",g aurav,jain has to be converted into
    |Gaurav,jain|ga urav|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
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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

    Comment

    Working...