How do I write a regex in javascript that matches all twitter like mentions (@something), but not email addresses.
I need to capture an unlimited number of mentions in a huge text field. Strings that have a non-printable characters and parentheses preceding the “@”, should be captured.
would be a simple solution, but since JavaScript does not support lookbehind it becomes a non-trivial task:
If you want to support a wider range of characters (as from your edit), you would use