I am looking for a regex pattern that matches any word that contains XYZ
and does not start with a colon :
.
For example, I would like to match from This isXYZ a :exampleXYZa
only isXYZ
.
My first idea was to use this regex pattern:
/(?<!\:[^\s\r\t\n])XYZ/
Basically, a negative lookbehind to assure that there is no colon without whitespace beforehand. However, this does not work, because lookbehind assertion must be fixed length.
EDIT: I would also like to have utf8 support.