I wrote this Regex to match any string before a .= or = or :=
How I could also add to if on the same line exists the word foo
it then did not match anything in that line?
https://regex101.com/r/tJRoDh/213
(?!.*foo)\b(\w+)\s*(\.=|=|:=)
x = foo
foo x=
x = foo
foo text :=
text := x text foo
^ don't match any of these because exist the word foo on the same line
---------------------------------------------
text HELLO:= text text
^ match hello
text x = text
^ match x
text .= something else y:= color
^ match text ^ match y
I'm using the regex on AutoHotkey to match all strings before .= = and :=