Hi Team,
This is my string.
ABC_NA_Final Report_<92765> ._17-10-2023_Selected OR
ABC_NA_Final Report_<78654> ._17-10-2023_Rejected OR
ABC_NA_Final Report_<98545> ._17-10-2023_Pending OR
I need to extract the text between ‘Final Report_’ and ‘._’ i.e 78654,98545,92765
After getting this I need to add all the extracted numbers to datatable for further use. Also the number of lines are dynamic.
Can anyone help please?
1 Like
rlgandu
(Rajyalakshmi Gandu)
2
@Happy_Coding
or
System.Text.RegularExpressions.Regex.Match(Input,"(?<=\_<)\d+(?=\>)").Value
1 Like
vrdabberu
(Varunraj Dabberu)
5
2 Likes
@vrdabberu , Thanks for your response.
Can you please help with writing the whole line for regex expression as I am new to regex.
vrdabberu
(Varunraj Dabberu)
7
Hi @Happy_Coding
Yeah sure uploading give me 2 mins. You have the complete data in a string variable right.
Regards
Yes , Complete data in a string variable.
Thanks @vrdabberu
vrdabberu
(Varunraj Dabberu)
9
HI @Happy_Coding
Please check the below workflow:
In the below flow I have splitted the string dtaa into multiple lines and extracted the data as per your requirement.
Main.xaml (18.4 KB)
Testingforum.xlsx (7.8 KB)
Regards
1 Like
Thanks @vrdabberu , It worked like magic.
I was exactly looking for this. 
In addition,
How can we extract Selected,Pending,Rejected. 
1 Like
I tried to modify the existing regex but I am getting some escape character error.
vrdabberu
(Varunraj Dabberu)
12
Hi @Happy_Coding
I have given the regex expressions for those and please refer below:
System.Text.RegularExpressions.Regex.Match(Input,"(?<=[A-Za-z]+\_.*\<.*\_)([A-Za-z]+)").Value
Regards
Hi @Happy_Coding ,
you can use regex to get the text .
if the strings are in a array ,

for each string ,
use regex to get values
cint(System.Text.RegularExpressions.Regex.Match(currentItem, “<(\d+)>”).Groups(1).Value)
output:
system
(system)
Closed
14
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.