In the following text what Regex (Javascript) would match "user" (user is a random name), excluding the "@" character?
I want to tag this @user here
and this @user
@user
I have looked at the following solutions and made the following regexes that did not work
RegEx pattern to match a string between two characters, but exclude the characters
\@(.*)\s
Regular Expression to find a string included between two characters while EXCLUDING the delimiters
(?!\@)(.*?)(?=\s)
Regex: Matching a character and excluding it from the results?
^@[^\s]+
Finally I made this regex that works but returns "@user" instead of "user":
@[^\s\n]+
The Javascript used to execute the regex is:
string.match(/@[^\s\n]+/)