Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 7 of 7
  1. #1
    Join Date
    January 2011
    Posts
    13

    Only printable characters in nicknames?

    I would like to allow only printable characters in nicknames, those are all ASCII in range of 32-126(dec) or 20-7E(hex). But I can not find correct regex for banlist. When I put in regex:

    .*[^0-9a-zA-Z]

    Only letters/numbers are allowed (and for reason unknown to me, spaces in nicknames are allowed too), that's not what I want. I want to include punctuation characters too. But when I put into name this regex:

    .*[^0-9a-zA-Z][!"#$%&'()*+,-./:;<=>[email protected]\^_`{|}~]

    Everything is allowed, even chars like , , (probably because there are many meta-chars inside of brackets). So how can I solve this?

  2. #2
    Join Date
    May 2006
    Location
    Europe/Czech Rep.
    Posts
    1,616
    perhaps
    Code:
    [^0-9a-zA-Z]*

  3. #3
    Join Date
    January 2011
    Posts
    13
    I'm not expert for regular expressions, but I think that is not correct. What you wrote is basically "zero or many characters neither numbers nor letters". That would be true for every string! :-)

    I also tried:

    .*[^ -~]

    It means "character not in the range between space and tilda", but it does not work. Why? I excluded space, and tried:

    .*[^!-~]

    Again nothing. I verified it on a few on-line regex testers, and it worked there. Why not in TS?
    Last edited by Rhinox; June 5th, 2015 at 06:39 PM.

  4. #4
    Join Date
    May 2006
    Location
    Europe/Czech Rep.
    Posts
    1,616
    Quote Originally Posted by Tomas View Post
    perhaps
    Code:
    [^0-9a-zA-Z]*
    your first post and myne works alright, just forgot about certain detail
    Code:
    .*[^0-9a-zA-Z ,#].*
    Yop this one allows also space # and ,

  5. #5
    Join Date
    January 2011
    Posts
    13
    Nice, but space, # and , are not enough. As I wrote, I want to allow all punctuation characters. All these:

    space][!"#$%&'()*+,-./:;<=>[email protected]\^_`{|}~

    (and letters/numbers, of course)

  6. #6
    Join Date
    December 2004
    Location
    RF
    Posts
    3,008
    That's not even 5% of all printable characters.

  7. #7
    Join Date
    January 2011
    Posts
    13
    I'm not talking about any printable characters, but about standart ASCII printable characters. ASCII table is coded by 7bits, that is 2^7=128 characters. 33 of them are "control chatacters", remaining 95 (including space) are "printable characters".

    Of course if you conside diffetent coding (i.e. UTF-8, unicode, ISO 8859, extended ASCII, etc), then you have many more printable characters.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Resolved] BBCode in Nicknames
    By SpyEye in forum Bug Reports [EN/DE]
    Replies: 11
    Last Post: March 20th, 2014, 08:25 PM
  2. Nicknames: Anyone can use yours
    By stalker34 in forum Permission System
    Replies: 26
    Last Post: August 29th, 2013, 11:49 AM
  3. Nicknames
    By AnEliteSoldier in forum General Questions
    Replies: 1
    Last Post: December 24th, 2011, 06:24 PM
  4. Phoneme Nicknames
    By Roanek in forum General Questions
    Replies: 0
    Last Post: December 20th, 2009, 07:44 PM

Posting Permissions

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