Results 1 to 6 of 6

Limiting characters in usernames?

This is a discussion on Limiting characters in usernames? within the Template Modifications forums, part of the vBulletin SEO Discussion category; Not exactly sure where to post this question, so asking it here. (Already tried at vB .com -- no replies ...

  1. #1
    Junior Member kpmedia's Avatar
    Real Name
    KP
    Join Date
    Apr 2008
    Posts
    10
    Liked
    0 times

    Limiting characters in usernames?

    Not exactly sure where to post this question, so asking it here.
    (Already tried at vB.com -- no replies in 5 days. Trying here and vB.org now.)

    Anyway...

    Need a little help here.

    I can see this in admincp vB options, but it's either too much filtering or not enough:
    Code:
    You may require the username to match a PCRE-type regular expression.
    (Do not start or end the expression with an escape character)
    Examples:
    ^[A-Z]+$ - Characters from A-Z only
    ^[A-Z ]+$ - Characters from A-Z including space
    ^[A-Z0-9 ]+$ - Alphanumeric characters including space
    ^((?!&#\d+;)[\x20-\x7E])+$ - ASCII characters from 32-127
    See PHP.net for more information on regular expressions.
    I want A-Z, 0-9, periods, underscore, spaces and hyphens --- and that's it.
    Any help on what this would be?

    I've had some new users with names like {{JOHN_THE*KING}}|| and that's a ridiculous name.
    The forum has been around for years, but only recently has this happened.

    And if you know how...
    Preferably no "repeat" periods/underscore/hyphen/spaces.
    i.e., "--BESTUSEREVER-- ___ -- 123"
    Better yet, limit to two total periods, underscores, hyphens, spaces
    I don't want any more users trying to use screwball usernames full of ASCII.
    Or even overusing what is allowable non-letter/non-number.

    Thanks.

  2. #2
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    try
    Code:
    ^[A-Z0-9 _-\.]+$
    limiting isn't really supported unless you have a true pattern.

  3. #3
    Junior Member kpmedia's Avatar
    Real Name
    KP
    Join Date
    Apr 2008
    Posts
    10
    Liked
    0 times
    Thanks much.

    I somewhat trust the advice of vBSEO Staff over the other vB sites anyway.
    Thanks for the quick assist.

  4. #4
    Junior Member kpmedia's Avatar
    Real Name
    KP
    Join Date
    Apr 2008
    Posts
    10
    Liked
    0 times
    Nope, that makes it to where nobody can register.
    I tried to enter a new username of "testIII" and it was rejected.
    If I leave the PCRE box blank, all is fine again, but still with the problem of using too much ASCII.

    Hmmm.... any other ideas?

  5. #5
    vBSEO Staff Andrés Durán Hewitt's Avatar
    Real Name
    Andrés Durán
    Join Date
    Jul 2009
    Location
    Costa Rica
    Posts
    3,393
    Liked
    411 times
    Blog Entries
    1
    Hello,

    You may replace the above regular expression with this one:

    ^[a-zA-Z0-9\.-_\s]+
    Andrés Durán / Crawlability Inc.
    ˇvBSEO 3.6.0 GOLD Liberado!
    Inaugurando el NUEVO vBSEO Sitemap Generator 3.0. - ˇAHORA disponible para Clientes de vBSEO!

    Síguenos en: Facebook | Síguenos en: Twitter


  6. #6
    Junior Member kpmedia's Avatar
    Real Name
    KP
    Join Date
    Apr 2008
    Posts
    10
    Liked
    0 times
    Thanks for trying Andres. Unfortunately that didn't work either.
    I chronicled what did/didn't work here: http://www.digitalFAQ.com/forum/show...scii-2823.html

    What I did turned out (so far) to be a "good enough" solution.

Similar Threads

  1. vBulletin 4.x Usernames with characters
    By vbreal in forum Troubleshooting
    Replies: 8
    Last Post: 06-12-2010, 03:29 PM
  2. vBulletin 4.x Usernames with special characters (e.g., hyphen) go to wrong profile
    By bob in forum Troubleshooting
    Replies: 1
    Last Post: 03-26-2010, 04:53 PM
  3. vBulletin 3.x Issue with non-alphanumerical characters in usernames... (urgent)
    By Nethox in forum Troubleshooting
    Replies: 1
    Last Post: 01-15-2010, 09:00 PM
  4. Usernames with ascii characters
    By zzcorp in forum Bug Reporting
    Replies: 1
    Last Post: 07-12-2007, 09:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •