Regex in textbox: Do not allow to enter blanks

Hello Together,
I encountered the following issue:
I would like to use the regex in textbox so that the user can’t input blanks.

Therefore, I added the regex: “/\w*\w$/”. That is what I experienced and either I am doing something wrong or it is not so helpful.

If I start with a blank: regexis working.
image

If I enter an alphanumeric character after a blank:
I would have expected to display an error but it is not thrown.
image

If I enter a blank after an alphanumeric character it works thanks to “$” - otherwise not:
image

If I enter another alphanumeric character after the blank, it stops working again:
image

Any ideas what I am doing wrong? Or room for improvement?

hi @PeCour

Can you try just with "/^[a-zA-Z]*$/ .
More over one thing, regex is a validation. So it will let you enter the data and then verify once the focus shits from the field.

You want the user to just enter Text. Is there a definitive length of characters?
If so you can use Input Mask…

Also if you could tell me a few potential input values that might be entered in this TextBOX.

Thanks

Happy Automation! :smiley:

1 Like

Hi @adiijaiin,

thank you for your help. Thanks to it, I found the answer myself.

When using regex in Apps one has to indicate the start and end of the regex.
Therefore, the regex works now /^\w*\w$/ as I added: “^”.

I think this information should be added to the help page Apps - Textbox (uipath.com).

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.