m0e91
(M0e91)
October 5, 2020, 8:18am
1
Hello Guys,
I have the below message, I need to extract the number from it, but the trick here is that the number in between can be any number of characters(ex. it could be 2009, or 20099, or 200997 can any one support please.
Shipment costs 200997 saved
It’s very easy to extract with a regular expression (Regex match).
E.g.
Shipment costs ([0-9]+) saved
Have a look at Regex101 ot test your expression
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.
Srini84
(Srinivas)
October 5, 2020, 8:24am
3
@m0e91
You can use Regex for this as below
Hope this helps you
Thanks
m0e91
(M0e91)
October 5, 2020, 8:49am
4
@mwerner , thanks for your reply,
Shipment costs 200997 saved is in a variable, can you support to have the syntax, as iam new to uipath.
Hello
The result is an ienumerable variable type - which is like an array.
Use the following syntax in a write line or assign activity to view the result.
MATCHESRESULTVARIABLE(0).tostring
Then update the capitals letters with the result/output from the matches activity.
If you want to learn Regex - check out my new user Regex Megapost.
3 Likes
system
(system)
Closed
October 8, 2020, 9:19am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.