"Unprintable" isn't really a directly meaningful thing. Even characters that themselves have no visible output can be used legitimately. Some examples include emoji color variants and emoji flags. As noted, the particular characters here do change how text is displayed when supported; in some cases, this even includes when used in conjunction with some basic ASCII characters.Is there no way to programmatically detect unprintable characters and restrict their usage?
Well presumably usernames are the primary situation where it comes up and you can restrict those to match a particular set of characters/match via the user name regex function.How are we supposed to detect unprintable characters from a moderation point of view?
A "blank" username is fairly obvious, but how about a username with arbitrary whitespace padding?
Well presumably usernames are the primary situation where it comes up and you can restrict those to match a particular set of characters/match via the user name regex function.
/[:ascii:]/i
- would that work? Would we be better using /[:graph:]\s/i
to avoid control characters included in :ascii:?/[:graph:]\s^@/i
?This should work: (The option currently adds delimiters and is case insensitive.)Can you give us an example username regex for basic alpha numeric and spaces?
^[a-z0-9 ]+$
That won't allow uppercase?
This should work: (The option currently adds delimiters and is case insensitive.)
ah ok, thanks. Didn't know that.The call being made automatically set the search to be case-insensitive, so it's fine.
Whoa whoa whoa, hold up.
Does this also mean that users are going to be able to register with emoji usernames? Like, I could register as "?"
Would it be better in the example above if the member registered with a user name of "Flag of South Korea Flag of South Korea Flag of South Korea" ?
gogo regex abuse:Could we just use something like /[:ascii:]/i - would that work? Would we be better using /[:graph:]\s/i to avoid control characters included in :ascii:?
Then if we want to exclude @ symbols, how about /[:graph:]\s^@/i ?
^[ -~]+$
We use essential cookies to make this site work, and optional cookies to enhance your experience.