PeCour
March 25, 2024, 2:27pm
1
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.
If I enter an alphanumeric character after a blank:
I would have expected to display an error but it is not thrown.
If I enter a blank after an alphanumeric character it works thanks to “$” - otherwise not:
If I enter another alphanumeric character after the blank, it stops working again:
Any ideas what I am doing wrong? Or room for improvement?
adiijaiin
(Aditya Jain)
March 25, 2024, 3:54pm
3
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!
1 Like
PeCour
March 26, 2024, 6:39am
4
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) .
system
(system)
Closed
March 29, 2024, 6:40am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.