How to test for a valid twitter handle using a regular expression

I use Redmine CRM, which allows custom fields in the Contacts, Deals and other modules.  The validity of an entry may be tested with a regular expression.  I had to do quite a bit of testing before I finally got it right (not doing this every day!), so here is what I ended up using:

^@([A-Za-z0-9_]+{1,15}$)

Meaning is should start with an “@” and then have at least 1 of A-Z, a-z, 0-9 or _, but not more than15.

Hope this helps someone else somewhere, sometime 🙂