Define complex Regular Expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drBuddha
    New Member
    • Oct 2007
    • 27
    • 3.6.x

    Define complex Regular Expression

    Hi,

    I want to create a regular expression for the username field on registration, that disallow users from using certain words, and some characters limitations.

    By seaching the forums I have found some expressions that could help me, but I'm not sure about the right way to combine it together.

    Code:
    (?!^term1$)^[a-zA-Z0-9 _-]+$
    I think, this should disallow from people to use the word "term1" and to force them to use this only characters.
    If then, I want to add here also "term2" as a forbidden string.

    Can you organize it for me plz?

    Thank you.
  • peterska2
    Senior Member
    • Oct 2003
    • 8869
    • 3.7.x

    #2
    Don't try using regex to disallow usernames. This is already available in your AdminCP.

    AdminCP > vBulletin Options > vBulletin Options > User Registration Options > Illegal User Names

    Comment

    • drBuddha
      New Member
      • Oct 2007
      • 27
      • 3.6.x

      #3
      Nice, I guess that you understood what am I planning, cause you have replyed on my second question.
      But as like there, you are trying to avert me from a true solution by compromise and using common options on my system.

      So, like you have already indicated, I want to use the regex to disallow usernames. The option that available in AdminCP is useless for my needs, as I explained here.
      Can you, or anybody else help and tell me how to do that?

      Thanks anyway.

      Comment

      • peterska2
        Senior Member
        • Oct 2003
        • 8869
        • 3.7.x

        #4
        This requires custom coding which we cannot officially support. Try asking for help with this at the vB Mod site: www.vbulletin.org

        Comment

        • drBuddha
          New Member
          • Oct 2007
          • 27
          • 3.6.x

          #5
          Give me a favor! Don't rubbish me with that sentence.
          I have not asked to code some custom code in the system!

          I asked only for some help with that regex thing, for use in the username field on registration at AdminCP.

          This regex works alone:
          Code:
          (?!^[COLOR=Red]term1[/COLOR]$)^.+$
          This regex works alone too:
          Code:
          (?!^[COLOR=Red]term2[/COLOR]$)^.+$
          And this regex, also works alone:
          Code:
          ^[[COLOR=Red]a-zA-Z0-9 _-[/COLOR]]+$
          I want to know how to connect all these three together. That's all!

          Comment

          • peterska2
            Senior Member
            • Oct 2003
            • 8869
            • 3.7.x

            #6
            Regex is custom coding.

            Help with Customizing vB

            Comment

            • drBuddha
              New Member
              • Oct 2007
              • 27
              • 3.6.x

              #7
              Even when it's on a regular field at AdminCP?
              I don't understand why it's different from any other functions there.


              Anyway,
              sorry for bothering you.

              Comment

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