I’m looking a symbol regex in PHP that will check submitted usernames and reject them if they contain symbols other than an underscore? I want it to also support numbers also.
I have no idea where to start with it… I’ve tried looking online but to no prevail. Thanks in advance. If you could give me a push in the right direction I’d appreciate it hugely.
In PHP:
I encourage you to learn Regular Expressions.
Note: If you weren’t including the underscore, I would suggest
ctype_alnum()and avoid Regular Expressions.