How to restrict usernames to alphanumeric


Posted by Support , Nov 05,1999,18:03 Post Reply      Main Forum
In the Configure->Forum Control Policy

there is a field named "List of forbidden names separated by |", the forbidden names here can actually be a general regular expression.

For our problem, we don't want any characters that is not a digit or alphabet character, the pattern for this is:

[^a-zA-Z0-9]


Explanation:
[ ]: used to express a set of characters
a-zA-Z0-9 inside [] means characters 0 to 9, a to z and A to Z
^ at the begining means NOT.

Therefore:
[^a-zA-Z0-9] means anything that is not alphanumeric.

Current pageAuthor Profile