Hello, thank you for your reply.
Yes, I could have used that functionality instead of creating another one. But the difference is that the code I shared implements a whitelist which is always in general a better practice than a BlackList and also this regular expression only applies to characters with GM/Admin status.
Greetings,
BinaryDev.