![]() |
Need some Regex help
Hello there,
So we were getting annoyed on our forums with stupid registration names. So we wanna setup a regex now so that they can't do this anymore. I know that this feature is available in the admin panel and we will also use that. I just need some help with the regex. Basicly what we want is we wanna allow these chars a-z A-Z 1234567890 and one space inbetween the name. The space inbetween the name is not a MUST, but if there are spaces in the name it should only be inside the name, and it should only be one. If anyone could help me with this one it would be greatly appreciated. |
I think this works:
Code:
^[A-Za-z0-9]+\s?[A-Za-z0-9]+$ |
Quote:
Thanks alot. |
Quote:
/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/ After matching one or more alphanumeric characters, if there's a separator it must be followed by one or more alphanumerics. |
Quote:
Thanks for the great help (y) |
All times are GMT. The time now is 08:43 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|