Special characters when registering

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • technopuzzle
    New Member
    • Apr 2008
    • 5
    • 3.6.x

    Special characters when registering

    Is there a way to keep users from registering account usernames with special characters or spaces?

    I am running Vb 3.8.2 and using a Joomla 1.5 bridge. This bridge imports the VB users into Joomla. But when a VB username contains special characters the bridge creates the Joomla accounts with underscores instead of the special characters (since Joomla usernames can not contain special characters). So then some usernames do not match and this causes login and other problems for those particular accounts.

    I figured the simpliest way to fix this is to keep VB from allowing special characters in usernames when a new account is registered.

    Can someone shed some light on how to make this happen. Thanks!
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    Try this:

    vBulletin Options > vBulletin Options > User Registration Options > Username Regular Expression: ^[A-Z0-9 ]+$
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    • technopuzzle
      New Member
      • Apr 2008
      • 5
      • 3.6.x

      #3
      Thanks I tried that but when trying to register an account I keep getting the message:

      That username is already in use or does not meet the administrator's standards. If you are techpuzz and you have forgotten your password, click here.

      I've tried to register several different usernames with a mixture of lowercase letters and numbers.

      Comment

      • Steve Machol
        Former Customer Support Manager
        • Jul 2000
        • 154488

        #4
        Hmmm...that worked when I tested it. You can find examples of many different regular expressions on this site:

        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment

        • Andy
          Senior Member
          • Jan 2002
          • 5886
          • 4.1.x

          #5
          Originally posted by technopuzzle
          Thanks I tried that but when trying to register an account I keep getting the message:

          That username is already in use or does not meet the administrator's standards. If you are techpuzz and you have forgotten your password, click here.

          I've tried to register several different usernames with a mixture of lowercase letters and numbers.
          The regular expression Steve suggested would not allow any lower case. Try this:

          ^[A-Za-z0-9 ]+$

          Comment

          • technopuzzle
            New Member
            • Apr 2008
            • 5
            • 3.6.x

            #6
            That worked perfectly! I did remove the "space" since I want to be 100% sure it won't cause conflicts with the Joomla user tables.

            Do you know what the ^ + $ are for or what they do?

            Comment

            • Andy
              Senior Member
              • Jan 2002
              • 5886
              • 4.1.x

              #7
              + matches previous item 1 or more times
              ^ positional indicator
              $ positional indicator

              By placing the ^ and $ around our expression it will make sure that there are no spurious characters preceding or following the user name.

              Comment

              • Steve Machol
                Former Customer Support Manager
                • Jul 2000
                • 154488

                #8
                Originally posted by Andy
                The regular expression Steve suggested would not allow any lower case. Try this:

                ^[A-Za-z0-9 ]+$
                Thanks for the correction Andy.
                Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                Change CKEditor Colors to Match Style (for 4.1.4 and above)

                Steve Machol Photography


                Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                Comment

                • cvn
                  Member
                  • May 2006
                  • 37

                  #9
                  Could some one please tell me how to allow also - and _

                  Thanks so much!

                  Comment

                  • Andy
                    Senior Member
                    • Jan 2002
                    • 5886
                    • 4.1.x

                    #10
                    Originally posted by cvn
                    Could some one please tell me how to allow also - and _

                    Thanks so much!
                    Try this:

                    ^[a-zA-Z0-9_\-]+$

                    Comment

                    • cvn
                      Member
                      • May 2006
                      • 37

                      #11
                      Originally posted by Andy
                      Try this:

                      ^[a-zA-Z0-9_\-]+$
                      Thank you so much for your help!

                      It works perfectly.

                      Comment

                      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                      Working...