The Nothing to repeat error is due to the * quantifier used to quantify an opening bracket of a capturing group construct.
You need to 1) escape special ( and ) chars, and 2) match any text between the closest ( and ) with a negated character class, here, with [^()]*:
\(not \([^()]*\)\)
Details:
\(not \( - a (not ( string
[^()]* - zero or more chars other than ( and )
\)\) - a )) string.
If there can be any zero or more whitespace chars between not and (, replace the literal spaces with \s*. If there must be one or more whitespaces, use \s+ instead:
\(not\s*\([^()]*\)\)
\(not\s+\([^()]*\)\)
/ /in VSCode.) So for your case for example it would be\(not \(.*?\)\)(however, your screenshot shows only one empty space, not two). Or, if you actually wanted to match exactly two characters in the parentheses,\(not \(..\)\)