I have following example: Regex (it should find $myvar but not @$myvar): (?<!@)\$myvar on text abcde @$myvar abcde $myvar kwrite highlights both as matches, but it should only find the second. I tested it successfully here: https://regex101.com/