Tuesday, 15 September 2015

regex - Need help capturing text between quotes and embedded quotes in a string using regular expression -



regex - Need help capturing text between quotes and embedded quotes in a string using regular expression -

here code. i'm using regexbuddy test with:

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

here sample of i'm testing with.

strings embedded qu \"the quick fox\" jumped on \"the lazy dog\" returns:

the quick fox\

the lazy dog\

"the quick fox" jumped on \"the lazy dog\" returns:

the quick fox

the lazy dog\

here problem i'm having: when capturing text between embedded quotes, matched text has backslash @ end. can tell me how include in regex pattern above?

thank you

\\?["][^"]+\\?["]

this matches within " , \", matches include " or \"

(?<=[\\]?")\s.*?(?=[\\]?")

this 1 matches without

" , \" , requires space behind every " or \" in text

regex parsing

No comments:

Post a Comment