def extract_mentions(txt):
 return re.findall(u'(?:[^\\w]|^)@([\\w]*)', txt)

def extract_mentions ( txt ) : return re . findall ( u'(?:[^\\w]|^)@([\\w]*)' , txt )
find all instances of @username in the string .