Accept and return @something but reject first@last.
r'@([A-Z][A-Z0-9_]*[A-Z0-9])
The above regexp will accept @something (starts with letter, ends with letter or number, may have underscore in middle, atleast 2 characters long) and returns the part after the @ symbol.
I do not want to return strings which contain some letters or number A-Z0-9 before the @ symbol.
Spaces, new lines, special characters, etc before @ is allowed.
CODE:
re.findall(r'@([A-Z][A-Z0-9_]*[A-Z0-9])', text, re.I)