I need to validate a username in PHP. It can be:
How do I do this?
Start with this:
/^[a-zA-Z0-9:.,?!@]{3,15}[#$^]?$/
then refine it to your needs. Try to see if you need escaping of the special char, but you should get the idea.
This means: from a to z, from A to Z, from 0 to 9 and :.,?!@ repeated from 3 to 15 times, optionally followed by one among #$^