Extract specific string from below string (using Regular Expression)

Hello everyone,

Below is the string from which I want to extract few strings which is higlighted in bold.

Need 2 solutions.

  1. Want to extract all the strings separately like 1,2,3…
  2. Want to extract all strings in For each loop

Please refer below string

2022-09-27 04:02:43 - Dexter Pax (Additional comments)
template mentioned OPP ID to update.
Δ Net Δ Direct Δ Other Δ Contract
47,868,588 7,454,998 2,484,999 13,881,888 11039259 11083245
85,559,700 45,562,551 15,187,515 24,809,638 11043432

clearly monthly capital charges

2022-09-22 04:35:29 - Dexter Pax (Additional comments)
Hi Team,
You are receiving this email as more information

Requesting you to check and confirm

Note- If you do not reply within 10 days with the additional information needed

Thanks
Team

2022-09-20 06:22:48 - Dexter Pax (Additional comments)
update is 190.374.683,06. thank you!

2022-09-20 02:05:26 - Dexter Pax (Additional comments)
Hi Team,
You are receiving this email as more information is needed

Note: String is dynamic and can contain any number of comments

Thanks,
Rushi

HI @Athawale_Rushikesh

You can try with this expression

System.Text.RegularExpressions.Regex.Match(YourString,"^\b\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\b.*").Tostring

Regards
Gokul

HI @Athawale_Rushikesh

In For each activity use this expression to get the count

Enumerable.Range(0,System.Text.RegularExpressions.Regex.Matches(YourString,"\b\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\b.*").Count)

Inside the For each activity

Use Log message to get the Data

System.Text.RegularExpressions.Regex.Matches(YourString,"\b\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\b.*")(CInt(currentItem))

Check out the XAML file

MatchesRegex1.xaml (6.6 KB)

image

Regards
Gokul

1 Like

Hi @Athawale_Rushikesh try this regex pattern:
image

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.