Hi, below regex is working correctly in regex online tester but not in uipath studio .I want to split the below string as shown in output .
string = large number (132.45,34) small unit 543.231 data 174.4567 test_number (888.99,00) Reserve_Number (290.881,56) Amount 6666.34 Total Amount (4568.99,56)
Regex :- [[:graph:]]+\d+[[:graph:]]+
The numbers with bracket can be matched with online regex tester but uipath can’t find any match for this .
Please help with this issue .
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.