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/
Works for me with 24.08. What might confuse is that if the cursor is on myvar we still highlight the other one due to the 'current word' highlighting.