Stop Allowing Spaces in User Names?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kau
    Senior Member
    • Jul 2002
    • 772

    Stop Allowing Spaces in User Names?

    I don't want new registers to be able to use spaces in their user name. Like;

    John Williams

    Is that possible without hacking vB?
    Group Builder
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Admin CP -> vBulletin Options -> User Registration Options -> Username Regular Expression

    Use this regex:

    Code:
    ^([a-z]|[0-9])+$
    That will allow only alpha characters and numbers.

    Comment

    • kau
      Senior Member
      • Jul 2002
      • 772

      #3
      What if I want to allow symbols like;

      John_Williams
      John+Williams
      John.Williams
      JohnWilliams!
      John-Williams
      Group Builder

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        I don't know the regex for that. If no one else here is able to help you with that then you can also try posting on www.vbulletin.org.

        Comment

        • Jose Amaral Rego
          Senior Member
          • Feb 2005
          • 11058
          • 1.1.x

          #5

          Ask to modifiy this string or just tell them what you want.
          Code:
          (?-i)(?=^.{8,}$)((?!.*\s)(?=.*[A-Z])(?=.*[a-z]))(?=(1)(?=.*\d)|.*[^A-Za-z0-9])^.*$

          Comment

          • Savage702
            New Member
            • Sep 2007
            • 11
            • 3.6.x

            #6
            I have a similar question, except I ONLY want people to register with a space between their first and last name.

            So for me, John Williams would be valid, whereas JohnWilliams or John_Williams would not be.

            Thanks

            Comment

            • Jose Amaral Rego
              Senior Member
              • Feb 2005
              • 11058
              • 1.1.x

              #7
              You can find and or request one to be made.

              Comment

              • Savage702
                New Member
                • Sep 2007
                • 11
                • 3.6.x

                #8
                Originally posted by Jose Amaral Rego
                You can find and or request one to be made.

                http://regexlib.com/UserPatterns.asp...1-40178cd4e0a4
                Thanks, I'll take a look.

                Comment

                • storpappa
                  New Member
                  • Dec 2006
                  • 21
                  • 3.6.x

                  #9
                  first_last
                  first_Last
                  First_last
                  First_Last

                  ([a-zA-Z]+[_][a-zA-Z]+)

                  I know it starts to work at requiring an underscore, but I need to modify this regex more so that it works with all names. There seems to be some very complex cases to deal with including Leonard_McCoy which would pass mine, but fail on a basic string that allowed for

                  ([A-Z][a-z]+[_][A-Z][a-z]+)

                  I just need a basic filter to make sure the users submit namefirstorlast_namefirstorlast
                  http://skamarakas.com
                  I like cats, especially with General Tso's sauce.

                  Comment

                  • Savage702
                    New Member
                    • Sep 2007
                    • 11
                    • 3.6.x

                    #10
                    Originally posted by Savage702
                    Thanks, I'll take a look.
                    Gave up on this a long time ago... but to combat SPAM registrations, started looking into it again. I found one, and modified it to suit my needs. Thought I'd post it here incase anyone else is running a real name board.

                    ^([A-Z][a-z]+)(\s|\-)([A-Z][a-zA-Z-]+)?(\s|\-)?([A-Z][a-zA-Z-]+)?$

                    This allows:

                    Jane Doe
                    Jane Doe-Smith
                    Jane Doe-Smith Jr

                    Comment

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