Regex for username?

I am using C # and jQuery for a valid username with Regex. Just studying :) I still have

UserName = "[a-zA-Z0-9]";

But this does not stop the characters? How to ensure the absence of characters or "." Or "_"?

thank

+5
source share
1 answer

This regular expression says “At least one letter or number” that you want “Every character from beginning to end is a letter or number”

"^[a-zA-Z0-9]+$"
+12
source

All Articles