What I want to know is how to modify following regex: \".*?\" so it will ignore escaped " character (\") so it won't end matching at \".
For example:
parameter1 = " fsfsdfsd \" " parameter2 = " fsfsfs "
I want to match:
" fsfsdfsd \" "
and
" fsfsfs "
but not
" fsfsdfsd \" " parameter2 = " fsfsfs "
etc...
Try this one:
"(?:\\"|[^"])*"
It matches "test \" though(you can probably avoid that using lookbehind). Escape the character if you need using \
Online Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With