I am using C# and jQuery to valid a username with Regex. Just learning :) So far I have
UserName = "[a-zA-Z0-9]";
But this doesn't stop symbols ? How to ensure that no symbols or " . " or " _ " ?
Thanks
If it doesn't have to be in code, you can go to regexr.com, and paste in your regex, and type in the text you're matching it up against. Why don't you want to check preg_match() against false? Some answers do not consider that MAYBE the regex to be validated comes from the input of an admin user of an app...
That regex says "At least one letter or number" you want "Every character from the start to the end is a letter or number"
"^[a-zA-Z0-9]+$"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With