I want to match all strings that start with an @ unless they have other characters in front of the @ as well. Simple example: in @one @two and bla@three
I want to match @one
and @two
but not @three
. It's for highlighting usernames in a chatroom.
These strings can be anywhere in a sentence (right at the start or in the middle).
I actually thought that (?![a-zA-Z])@[a-zA-Z]+
should work but it still matches @three
too.