[Fixed] Regex Gdevelop

Hi,
Im trying to make the user type his username, but I don’t want him to be able to set characters other than letters and numbers.
Using a regex filter would make it way more easier to check. But since we don’t have that, I wanted to know any way to do it ?
The only way I found is to search a character into a text like that for a space : prntscr.com/ilwju2
And so if the variable Error1 is >=0 then I can tell there is a space, but doing that for all character, I don’t think that’s the best way; or it would be like way too much variable to check each characters that are not letters or number.
Is there any way to do so ? Thanks :slight_smile:

Here is a “compressed” way to do it:
OnlyAlphanumeric.gdg (21.5 KB)
There is a structure variable with a lot of childs, each child has the name of an allowed character:

AllowedCharacters a = 0 ... z = 0 A = 0 ... Z = 0 0 = 0 ... 9 = 0
(No, I didn’t create child per child, I’ve edited the project file with Sublime Text :stuck_out_tongue:)

Then, each time the Text Entry object is modified (a character is entered), the entire string is checked, letter by letter, using the structure variable to know if the letter is allowed.

You’re just a god :’)

Imma make sure to give you credit when my game would be done!

I don’t even know what limit you can have on game you can create with your knowledge :’)