Javascript -- regex strings
Simple question... I am just baffled how to write the notation.
Example: input='..."aaaa\"bbbb"...'
I need regex to grab the string ignoring nested开发者_开发技巧 quotations.
I guess it can start like: input=input.replace(/[^\\]"...
How can I say 'all characters until a " which is not preceded by a \' ?
Thanks!
"([^"\\]|\\.)*"
Inside the quotes can be (a) any character aside from a quote or backslash, or (b) any character if it's escaped with a backslash. Repeat.
精彩评论