Negating a backreference in Regular Expressions

Instead of a negated character class, you have to use a negative lookahead: \bvalue\s*=\s*([“‘])(?:(?!\1).)*\1 (?:(?!\1).)* consumes one character at a time, after the lookahead has confirmed that the character is not whatever was matched by the capturing group, ([“”]). A character class, negated or not, can only match one character at a time. As far … Read more