Download

[Request] Allowed Character Filter on Input (UMG)

I haven’t seen any option for Character filter on inputs on UMG which to my idea will be a very nice option.

Example on the option panel in UMG designer it would be nice to have a feature where you can set [a-z] / [0-9] / [a-z-0-9] / [A-Z] [a-z-A-Z] / [a-z]+$

It’s very common in a lot of programming languages to use this approach.

[a-z] = lower letters a till z are allowed
[A-Z] = capital letters a till z are allowed
[a-z-A-Z] = capital and lower letters a till z are allowed
[0-9] = numbers 0 till 9 are allowed
[0-9]+$ = numbers 0 till 9 and special character $ is allowed.

i’m not sure if there is a way of character filtering in blueprint but it might be a nice feature.

if you would like a input where you can only input a email address you could set the filter to [a-z-A-z-0-9]+@+. this will be a correct email filter : example1234@example.com (correct) - example$@example.com (this woulden’t work because the filter won’t allow you to input a $ character and will just return a keyboard input false.

Please let me know if there is already something like this. i might have missed it.

inQonsole.

In general it’s somewhat dangerous to assume things about user entered text fields, as it is frequently far more complicated than it seems on the surface (e.g., your example above isn’t close to correct for email addresses: http://en.wikipedia.org/wiki/Email_address#Syntax). Names are another one that is far more complicated in practice: Personal names around the world

However, having said that, something like a callback per character entered to let you apply your own rules seems like it might be good. I’ll forward this thread over to the UMG team.

Cheers,
Michael Noland

Yes i understand what you are saying with allowed ASCII characters but i never seen any email hosting providers that allowed any special characters in there email. but you got a point its very hard to assume things that a user is going to enter. but it would be nice to have something like a callback per character to basically create your own filter.

if you would create a login screen with UMG it would be nice to have input filter of which characters you allow. i know it’s hard because you never know which kinda characters there email provider allows. even do for a character creation you could filter the character’s that a player could use in there display name.

in some scripting languages the most common used function would be to check if there is a single @ and a .
i also don’t know what would be a good implantation of a email filter or character filtering.

Most web applications now a days do legit email check.

Example :

“Invalid email address” error

Common reasons for getting this error

  • There’s an extra space in the middle of your username or your email address.
  • This happens most often if you’re trying to sign in with your name instead of your username/email address. For example “John Smith” instead of johnsmith332.
  • There’s more than one @ sign.
  • There’s invalid characters like parentheses, colons, semicolons, etc.
  • You’ve accidentally entered @hostname instead of @hostname.com

Thanks Micheal

There’s already a callback when the contents change, it’s up to you to filter the incoming character and choose if you want to allow the modification of the backing string you have that the textbox is bound to. That’s how we do it in the editor for these kinds of actions. You can also SetError on a textbox to cause it provide a built in error visualization.

My advice would be to just write a C++ library with Blueprint exposed functions that lets you pass in a string, determine if it’s valid.

This would be great if it was added.