I need to extract $x but not $$x and '$x'.
- Read $$x is invalid. Please use $x.
- You selected '$x' value as $x.
The following Regex works for 1.
\$x(?!$)\
I used the following Alternation (|) which had obviously failed for the second string.
\$x(?!$)|\$x(?!\')\
How to check for multiple negative lookaheads?
P.S: Should be compatible with Javascript Regex.