我有以下字符串:
here "is 'a' \"string\" that" does contain a 'lot of "weird"' stuff "i" to 'find'
我想提取is 'a' \"string\" that
,lot of "weird"
,i
和find
。
有任何想法吗?谢谢!
基于负向后的正则表达式应该为您工作:
/(["']).*?(?<!\\)\1/g
不支持后向的正则表达式,例如Javascript
/(['"])(?:\1|.*?[^\\]\1)/g
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句