Regex working in regex online tester but fails in uipath studio

UiPath is built on .Net Engine and .NET regex engine does not support POSIX character classes. It only supports regular expression character classes. This is the reason you are not getting the output. You have [[:graph:]] which has to be replaced with \w or [A-Za-z]+

Often people gets confused with POSIX class and CHaracter class. [x-z0-9] is an example of a “character class” and [:digit:] is a POSIX character class, used inside a bracket expression like [x-z[:digit:]].

To answe why you are getting result in online testers, there are different online regex testing websites. Some of which are built based on javascript. UiPath uses .NET based regex engine. The website you used to test online may not be built on .NET engine. You can use, .NET Regex Tester - Regex Storm which is a .NET regex tester and provides almost 99% accuracy when the expression is executed in UiPath.

Try the below expression. This with provide values along with the field names.
[A-Za-z_ ]+[0-9.,/(/)]+

Also use the OOTB UiPath activities IsMach and Marches instead of using a assign statement and writing custom VB code.

Let me know if this helps you.

5 Likes