In our registration form, we now want to ask the user to enter the name of their twitter (for example, @paul).
Can anyone tell me which characters are allowed in it?
eg. az, AZ, underline, 0-9
anything else?
I believe that these are letters, numbers and underscores and a maximum of 15 characters.
A quick search opened this post (not Twitter), covering the same topic:
http://kagan.mactane.org/blog/2009/09/22/what-characters-are-allowed-in-twitter-usernames/
The above article also contains examples of regular expressions to help you check:
Full regex – /^[a-zA-Z0-9_]{1,15}$/ Perl-compatible regex – /^\w{1,15}$/
Check this Twitter page for official guidelines / guidelines.
http://support.twitter.com/articles/101299-why-can-t-i-register-certain-usernames#
JavaScript Funcion:
function validTwitteUser(sn) { return /^[a-zA-Z0-9_]{1,15}$/.test(sn); }