Regex expression Issues

Hi i want regex expression that checks the format of my variable and retunes true if my format is correct

i want regular expression that checks the format jxn-12345-1 or ALA-34521-0, LOU-5643-1etc the variable value is dynamic, i want regular expression that can be true for all such formats
Currently I’m using format [1]{3}-\d±\d$ but it gives me false result
How can I improve my regex??


  1. A-Za-z ↩︎

Hi @Aima_Arif

Try using the following Regex Expression:

Hope it helps you!!

Regards,

Hey!

Try this:

System.Text.RegularExpressions.RegEx.IsMatch(strVariable,"[A-Za-z]{3}-\d{4,}-\d{1}")

Reference:

Regards,
NaNi

Hi @Aima_Arif

To match the format you described (e.g., “jxn-12345-1” or “ALA-34521-0”), you can use the following regular expression in UiPath:

[1]{3}-\d{5}-\d$

Thanks!!


  1. A-Z ↩︎