How to ban all special characters from a TS3 server

Post Reply
squirrelof09
This is my homepage
This is my homepage
Posts: 76
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Mon Mar 14, 2011 5:09 pm

How to ban all special characters from a TS3 server

Post by squirrelof09 »

Teamspeak 3

Spent a bit of time googling how to use regular expressions to ban all characters except a-z, A-Z, 0-9 in nicknames on TS3. After a bit of thinking, I had to allow [ ] also considering my communitys tag name is [TOG]. It's not been a problem for my server, but I decided I would address this before users think they can join my TS3 servers using special characters.

My ban entry will disallow anyone joining or changing their nickname to any character that does not match the following characters a-z A-Z 0-9 [ ] - ^

To do this, I put the following entry in the ban list
.*[^a-z^A-Z^0-9^\[^\]^\-].*

The guide I used for learning this I found here http://developer.qt.nokia.com/doc/qt-4.8/qregexp.html It explains how the carrot ^ creates those characters as an exception to being banned.

In order for me to allow the brackets [ ], I had to escape them with a slash \ for example ^\[ and ^\] . If you don't escape them with a slash, it will cause the regular expression to not work as intended.

For those of you who are just interested in allowing just a-z A-Z and 0-9 the following string will allow just that.
.*[^a-z^A-Z^0-9].*
Post Reply