regex - Java Pattern.compile ignoring escaped double quotes (\") -


i having hard time figuring out pattern ignore escaped quotes. want this:

    "10\" 2 topping pizza, pasta, or sandwich $5 each. valid until 2pm. carryout only.","blah blah"  

to match as:

   1> "10\" 2 topping pizza, pasta, or sandwich $5 each. valid until 2pm. carryout only."    2> "blah blah"  

i have been trying this:

    pattern pattern = pattern.compile("\"[^\"]*\"");     matcher matcher = pattern.matcher(filteredcoupons); 

and

   1> "10\"    2> ","  

the regex looking is

"[^"\\]*(?:\\.[^"\\]*)*" 

see demo

in java,

string pattern = "\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\""; 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -