so I have a string like hello $1
and another string hello \$1
I want to use a regex test to check if the dollar has a backslash behind or not. If it has one then test
must evaluate to false and if it doesn't have one behind then it must evaluate to true.
example:
let string1 = "hello $1";
/regex/.test(string1); //-> returns true
let string2 = "hello \$1";
/regex/.test(string1); //-> returns false
I already tried this /[^\\$]\$[1-3]{1}/.test(string)
but it doesn't work. Thanks in advance