I need to match @anything_here@
from a string @anything_here@dhhhd@shdjhjs@
. So I'd used following regex.
^@.*?@
or
^@[^@]*@
Both way it's work but I would like to know which one would be a better solution. Regex with non-greedy repetition or regex with negated character class?
See Question&Answers more detail:os