Regular Expression - Reverse Pattern Searching

Sean

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.

B W

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Regular expression in reverse

From Dev

Regular expression for searching for extra backslashes

From Dev

Regular Expression for the Pattern?

From Dev

Regular Expression pattern issue

From Dev

Perl Regular Expression Pattern

From Dev

regular expression repeating pattern

From Dev

Javascript regular expression pattern

From Dev

String pattern, regular expression

From Dev

Regular expression to validate the pattern

From Dev

sawmill Regular expression pattern

From Dev

Custom regular expression pattern

From Dev

regular expression and pattern matching

From Dev

Regular expression not matching pattern

From Dev

Regular Expression to match pattern

From Dev

mognoose searching with regular expression in multiple columns

From Dev

searching database with regular expression condition using php

From Dev

Searching and printing regular expression from a file in python

From Dev

Regular Expression for Searching Duplicate Word in java

From Dev

Setting the Starting Position to Begin Regular Expression Searching

From Dev

Syntax for regular expression searching for DNA codons

From Dev

How to use regular expression while searching in HashSet

From Dev

Regular expression - street address pattern

From Dev

Regular Expression, Get Sub Pattern

From Dev

Regular expression to match specific pattern

From Dev

Lookaround regular expression pattern in R

From Dev

regular expression that matches the below pattern

From Dev

Regular expression - starting and not ending with a pattern

From Dev

regular expression in java matcher pattern

From Dev

Regular Expression - Match String Pattern