I need to write a regex in python to extract mentions from Tweets.
My attempt:
regex=re.compile(r"(?<=^|(?<=[^a-zA-Z0-9-_\.]))@([A-Za-z]+[A-Za-z0-9]+)")
It works fine for any mention like @mickey However, in mentions with underscores like @mickey_mouse, it only extracts @mickey.
How can I modify the regex for it to work in both cases?
Thank you