req7
(Felipe Leite)
March 18, 2020, 5:20pm
1
Hello everyone,
I have a .txt file from which I read a large text, filled with strings. However, I just want to get the strings that start with three letters and the rest are numbers (example: BTV1138903 or BCU507).
How could I make this kind of condition?
I’ve been trying to solve this problem for a few days and I still haven’t succeeded
Somebody help me please
Madhavi
(K)
March 18, 2020, 5:28pm
2
Use regex activities, IsMatch and Matches
Specify input as your text from.txt file
Pattern as [A-Z]{3}[0-9]*
For more references see
Once you get the email body, use regular expression to extract the required values. In UiPath, there are two extensive regex methods that will help you achieve this, IsMatch and Matches.
Below are the expressions you can use,
Total:
(?<=total[ :]+)[0-9.,]+
Average:
(?<=average[ :]+)[0-9.,]+
References:
1 Like
Use this regex where MyStr
is your string:
MyStr = System.Text.RegularExpressions.Regex.Match(MyStr, "[A-z]{3}\d+").Value
.
3 Likes
req7
(Felipe Leite)
March 18, 2020, 11:51pm
4
Thanks everyone for the answers! They helped me a lot, especially Anthony_Humphries’s
system
(system)
Closed
March 23, 2020, 7:49am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.