How do you limit special characters in the input field for usernames?

Regex is probably better suited to your needs. Find & replace works too, ultimately your own choice.

A regex filter equal to:

(\`|\~|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\+|\=|\[|\{|\]|\}|\||\\|\'|\<|\,|\.|\>|\?|\/|\""|\;|\:|\s)

…filters out all of those characters. I use Regex when there’s a lot of restrictions on input.

See: Automatic creation of sub-app, subdomain DNS, SSL

5 Likes