No whitespace or special characters from a TextBox ?

Hello everyone,

I’ve been looking for this since yesterday and i can’t find a solution… I’m explaining myself :

I’m trying to create a registration system in BP with some restrictions, using a TextBox for the fields completed by users. For example, players can’t use an username with a whitespace or a special character. Same for their password etc… They can use only “normal” characters : [a-z] [A-Z] [0-9] I’ve tried a lot of things but it doesn’t seems to work so i think i’m missing something right now… I’ve been looking for hours on the web but without any success !

Could you please help me ?

Thanks in advance !

You’d need a custom textbox class which implements ReGex on result string (regular expressions).

Or you can format string manually in UMG, kind of boring thing to do.

Thanks to your advices, i managed to find this plugin : LE Extended Standard Library in Code Plugins - UE Marketplace
Then i did this little test and it works just fine :

https://image.noelshack.com/fichiers/2018/27/6/1530923699-solutionregex.png

Maybe it’s not a perfect way to do this one character by one character ? But for now, it works, so it’s fine for me.
Anyway, thank you !

I figured out than my previous solution wasn’t a good thing because there are too many special characters !
So i did this instead :

https://image.noelshack.com/fichiers/2018/27/6/1530994381-problemcharactersscript.png

It’s working perfectly BUT i have one major problem ! If one value is true it’ll execute the next step of my script (not shown here), even if there is one wrong character in it ! So… how can i do to stop my script if only one value is wrong ?

I hope i could have an answer !

After hours, i figured it out myself ! Here is the solution, it might help someone in the future, even if it’s maybe not the most efficient way to do it !

https://image.noelshack.com/fichiers/2018/27/7/1531028166-problemsolution.png

Regex is very powerful … for example, if you want only the standard letters and numbers you can use this regex rule: ^[a-zA-Z0-9]*$
This says, take the entire string and check for only letters and numbers. If you use the “regex match” function connected into your branch, you’ll get true for this value “aBc123” and false for “aBc%321” or “!#$%”, for example. So you could condense your entire regex part of your BP to just “regex match” and then modify my example rule to include or exclude the characters that you want.

Thanks man! You helped me find the parameter convention.


  1. a-zA-Z0-9 ↩︎