The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Username Regular Expression
Hello,
In my board, have the below setting - User Registration Options > Username Regular Expression - ^[A-Z0-9]+$ so that it allows alpha numeric characters in user names. But am looking for expression that does not allow user names that has ONLY numbers like - "12345". How do I set this? Thanks in advance. |
#2
|
|||
|
|||
I found this: ^\d*[a-zA-Z][a-zA-Z0-9]*$
here: http://stackoverflow.com/questions/1...-one-character. It allows lower case, but you could take out the lower case ranges if you want (or I guess it doesn't matter to vbulletin). |
#3
|
|||
|
|||
Hello Kh99,
Thanks for the response. Yes it seems to be working good but I would also want to disallow user names that starts with numbers like - "1234test". In such a scenario how do you think the regex need to be? Do you think this will work - ^[a-zA-Z][a-zA-Z0-9]+$ |
#4
|
|||
|
|||
Yes, I believe you'd just want to remove the \d* from the beginning. You could change the last * to + as you've done, but I think that would just require the username to be at least 2 characters, and vbulletin already requires at least 3.
|
#5
|
|||
|
|||
Thanks Kh99,
It did work good. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|