Is there a way using regular expression to find all " that doesn't match multiple patterns.
Example: "I'm having a hard time"|"getting this "match" to"|10|"work"
Basically I want to replace the quotes that doesn't match ^" "| |" or "$ So in this scenario it would only replace the quotes around "match"
In this particular case, I'm attempting to us VI to do this.
Thanks for any suggestions you can provide.
You could try using negative lookbehind and negative lookahead:
:%s/[$|]\@<!\"[\^|]\@!//gc
Edit: I changed my approach. Is the following regex sufficient?
:%s/\([^\^|]\)\"\([^$|]\)/\1\2/g
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments