Regular Expression for "For loop"

Can anyone help me with this…Actually i want to mask the input given by the user using regular expression.

Thanking you in advance!!

1 Like

can you be more specific ?
what do you want to do actually?

thank for replying

I want to mask the data from the user which inputs using regular expression.
for eg if the input is “1234567890”
the output must be “******7890”

thank for replying

I want to mask the data from the user which inputs using regular expression.
for eg if the input is “1234567890”
the output must be “******7890”

Using Regex??

yes
thanking you
emm

you always have numbers??
like only 10 digits??

No sir, It can be anything string or digits.

Thanks for replying quickly

(?<=.{5}). this is working Regex101.com
not in uipath builder

Check this regex to identify the numbers, special characters and strings.
[0-9A-Za-z^\w*]{6}

1 Like

Hi
Hope this expression would help you resolve this
If the input is stored in a variable named str_input
Then In assign activity
str_output = System.Text.RegularExpressions.Regex.Replace(str_input.ToString,”^[0-9]{4}”,”****”).ToString

Cheers @emm

thank you so much for helping me!!

This is only working for numbers only if it is mixed of strings and integers whats should we do?

Greetings

Thank you so much!!!
This Function is working :slight_smile:
Can you help me with this also
input - “111-111-111”
output- “xxx-xxx-111”

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