Announcement

Collapse
No announcement yet.

Username Regular Expression PCRE Help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Username Regular Expression PCRE Help

    i am presently using: ^[A-Z0-9 ]+$
    which means: Alphanumeric characters including space

    Now, i want an expression where besides above condition, nobody is allowed to register with numeric only username.

    e.g.

    username:
    abcdef is perfectly fine!
    abc123 is perfectly fine!

    but username:
    123456 should not be allowed!

    What would be the regular expression?

    Thanks


  • #2
    I am also still looking for it, Anyone help please.

    Comment


    • #3
      Well, you could use this:
      Code:
      [^0-9]
      which just says that there has to be at least one non-number somewhere in the name. Note that that doesn't do what the first poster asked for because it doesn't limit the characters to letters, numbers, and spaces. But I saw your other thread and I don't think you asked for that, so maybe this will work for you.

      Edit: I think this will work if you want to limit the allowed characters, but also prevent all numbers:
      Code:
      ^[A-Z0-9_ -]*[A-Z_ -]+[A-Z0-9_ -]*$
      This example allows letters, numbers, and _, -, space, but not all numbers. (Note that if you want to allow '-', then it has to be listed last in the brackets, or else it will cause an error).
      Last edited by kh99; Fri 1st May '15, 7:28am.

      Comment

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