I want to match certain symbols only when they are not prefixed by specific characters. For instance, match “))))))))))” when it is not preceded by “x”. Need some advices. My current expession is
(?<!x|X|:|=|\\1)([\|()\[\]])+
which does not work.
[EDIT] Rephrase my question
This makes use of the “negative lookbehind assertion”: we want as many parentheses as possible, not preceded by either “x” or “)” (the latter because otherwise, we would get the parentheses starting from the second parenthesis, preceded by the first parenthesis and therefore not an “x”)