Jump to content

Username validation


speedy33417

Recommended Posts

My username validation works on these principals:

 

First letter must be alphanumerical

All other letters must be alphanumerical plus space and -_.

 

I use the following code

 

if (preg_match('/^[A-Za-z0-9][A-Za-z0-9-_.\s]/',$username))

...

 

The problem is that it validates this:

 

xxxxx™

 

How can I make sure that my username does not accept trademark sign and similar characters?

 

Thank you!

Link to comment
https://forums.phpfreaks.com/topic/221362-username-validation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.