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 !
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 ?
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 !
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.