[REGEX] Acceptable nickname regular expression
#1

Hi,

I'm programming some user interface in PHP, and I'm having a little problem with acceptable nicknames.

I know these are the accepted characters:
a-z A-Z 0-9 . _ $ @ = ( ) [ ].

and you need 3-20 characters. (can be done with strlen)

Does anyone have a regular expression laying around or knows how to make a regex for checking if any other characters than those allowed are posted($username)?
Reply
#2

Not too good with regex, but I think it's basically just this:

Code:
^[A-Za-z0-9\._\$@=\(\)\[\]]+$
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)