Hi Team,
My string value is
String =Order not Confirmed: 6 DAS C40\r\nETA MARCH 20, 12:26PM\r\n\ fr\r\n— ORDER —\r\nRECEIVED\r\nEL rT TT Tea\r\ni 7 7 Coventry\r\n2 J Farlington 3\r\nEy 3 Y,\r\nNn \\r\nBostwick i: AN\r\ni 3,\r\nso N © iy\r\n7 | 4\r\n. ) I, 5,\r\n@ocgo | N I\r\nOnden #\r\n25504618965827585\r\n2.81 MILES |\r\n— NOLO); oo\r\nSC Nero\r\n@idoER RECEIVED)\r\nHOME REWARDS & MENU REORDER ACCOUNT\r\nJ oO O",
in these I need “25504618965827585” these value change dynamically
please anyone help me on the Regex on these String
Thank you
mkankatala
(Mahesh Kankatala)
2
Hi @Mada_Sai_Krishna
Check the below regular expression,
(?<=#.r.*)\d+(?=.r.)
Store the input data in a variable called Input_Str.
- Assign -> Output = System.Text.RegularExpressions.Regex.Match(Input_Str.toString, "(?<=#.r.*)\d+(?=.r.)").Value
Hope it helps!!
Yoichi
(Yoichi)
3
Hi,
How about the following?
System.Text.RegularExpressions.Regex.Match(yourString,"(?<=Onden #(\\r\\n|\s+))\d+").Value
Sample
Sample20240321-7 (2).zip (2.7 KB)
Regards,
Hi @mkankatala,
it’s not working.
mkankatala
(Mahesh Kankatala)
5
Those regex work for me.
Could you share your workflow how it looks… @Mada_Sai_Krishna
please find the attached Xaml for your reference
Sequence.xaml (9.7 KB)
I need value in C# project
Vikas_M
(Vikas M)
7
Hi @Mada_Sai_Krishna
If the Number length is fixed then you can go with below regex
\d{17}
if its not fixed then kindly go with below regex
(?<=\\r\\n)\d+(?=\\r\\n)
Hope it helps you out!
mkankatala
(Mahesh Kankatala)
8
Could you try the below expression in your workflow… @Mada_Sai_Krishna
System.Text.RegularExpressions.Regex.Match(Rawtext.ToString(), @"(?<=#.r.*)\d+(?=.r)").Value
Hope it helps!!
Yoichi
(Yoichi)
9
HI,
Can you try the following?
System.Text.RegularExpressions.Regex.Match(Rawtext,@"(?<=Onden #\s+)\d+").Value
Sample
Sample20240321-8CS.zip (6.0 KB)
Regards,
1 Like
mkankatala
(Mahesh Kankatala)
12
It’s my pleasure… @Mada_Sai_Krishna
Happy Automation!!
system
(system)
Closed
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.