How to filter Mathematical Alphanumeric Unicode characters in Word Filter?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
ciaoamigos
Posts: 70
Joined: 05 Sep 2021, 16:57

How to filter Mathematical Alphanumeric Unicode characters in Word Filter?

Post by ciaoamigos »

Hello everyone,

I'm looking for advice on how to configure the SmartFoxServer Word Filter to block messages containing mathematical Unicode characters—specifically the Mathematical Alphanumeric Symbols range (U+1D400–U+1D7FF).

I tried adding a regex like:

Code: Select all

(?:\uD835[\uDC00-\uDFFF])

But it doesn’t seem to work, and even adding the fancy characters directly to the filter is not effective in all cases.

Question:
Is there a way (with regex or otherwise) to configure the Word Filter to block any message containing Mathematical Alphanumeric Symbols (U+1D400–U+1D7FF), or is it necessary to manually add every possible variant for each word?

Any tips or best practices on how to handle Unicode “fancy” characters in the Word Filter would be greatly appreciated!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to filter Mathematical Alphanumeric Unicode characters in Word Filter?

Post by Lapo »

I am no regex expert but I would recommend googling how to do that in Java.

You can also use this site:
https://regex101.com/
to test the regexp, it supports all kinds of languages.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply