I have the following string:
here "is 'a' \"string\" that" does contain a 'lot of "weird"' stuff "i" to 'find'
I want to extract is 'a' \"string\" that, lot of "weird", i and find.
Any ideas? Thanks!
This negative lookbehind based regex should work for you:
/(["']).*?(?<!\\)\1/g
Regex without support of lookbehind e.g. Javascript
/(['"])(?:\1|.*?[^\\]\1)/g
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