Regex for usernames in registration form.

Nasr

Well-known member
How do I exclude certain characters in usernames on registeration form? I want to prevent users from using numbers and english letters since my forum is in Arabic... how do i do that?
 
Admin CP -> Home -> Options -> Users and Registration -> User Name Match Regular Expression

This regex should do what you want. I tested it and it appears to work.

Code:
^[^a-zA-Z0-9]+$
 
Hi. I'm moving my forum from vB to Xenforo. Just finished the import and I need to set up things the way they were.

For usernames, I need to allow only greek letters and spaces. Meaning, lower case letters from α to ω, uppercase letters from Α to Ω and vowels bearing accents: άΆέΈήΉίϊΐΊΪόΌύϋΰΎΫώΏ

I have tried this expression:
^[α-ωΑ-ΩάΆέΈήΉίϊΐΊΪόΌύϋΰΎΫώΏ ]+$
in:
Admin CP -> Home -> Options -> Users and Registration -> User Name Match Regular Expression

but I get: Invalid regular expression
 
Just for the record, it was the range that didn't seem to work properly. Having the letters one by one has worked for me:

/^[αβγδεζηθικλμνξοπρσςτυφχψωάέίϊΐήύϋΰόώΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΆΈΊΪΉΎΫΌΏ ]+$/i
 
Top Bottom