1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Regex for usernames in registration form.

Discussion in 'XenForo Questions and Support' started by Nasr, Dec 25, 2010.

  1. Nasr

    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?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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]+$
    
     
    Nasr likes this.
  3. Nasr

    Nasr Well-Known Member

    Thank you very much, Jake. I truely appreciate your help.
     
  4. Stuart Wright

    Stuart Wright Well-Known Member

    Could I also request some regext help please?
    We need the opposite. Letters, numbers, spaces and dashes only.
    Thanks
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    ^[a-zA-Z0-9 -]+$
     
    RoldanLT likes this.
  6. Stuart Wright

    Stuart Wright Well-Known Member

    Awesome, thanks Brogan (y)
     

Share This Page