Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to find everything except /"[^"]*"/g

i tried many sites but didnt get any answer yet

i tried this

str = 'xy"ab"bc"cd"de"gh"jk' ;

/(?!"[^"]*")[^"]*/g

/* i want this result >> xy,bc,de,jk */

What I have tried:

str = 'xy"ab"bc"cd"de"gh"jk' ;

/(?!"[^"]*")[^"]*/g

/* i want this result >> xy,bc,de,jk */
Posted
Updated 26-Aug-16 17:19pm

1 solution

I would not try to inverse /"[^"]*"/g.
I would do a replace with this RegEx to comma, and then split on comma.
 
Share this answer
 
v2
Comments
prasad sawant 27-Aug-16 0:55am    
(?!"[^"]*") this negative ahead only works as (?!") why ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900