One thing I'm doing in something I've started to work on is use the StripString function. The strip string function removes characters from a string. You would load it with characters you want to allow and then if there's any characters left after stripping the valid ones then that would suggest that the name is invalid.
Here's what I mean
inputName = "Kev1n Cross"
if (StripString(inputName, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz) <> "")
// Name contains invalid characters
// After stripping the characters above you're left with 1 so it's not equal to blank
endif
if (StripString(inputName, "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz) <> "")
I'm using this to only allow alphanumeric usernames, and have added some special characters to it for when checking for valid passwords.
https://www.appgamekit.com/documentation/Reference/Core/StripString.htm