Regular expression date

Hi,
I need to extract June 04, 2022 from the following:

Total Amount Due $1210.23
June 04. 2022
Date Extension\grace period: 2 months

How can I do this?

Thank you so much,

1 Like

Hi

Hope this expression helps in assign activity

Str_output = System.Text.RegularExpressions.Regex.Match(str_input.ToString, “([A-Za-z]+ \d{2}. \d{4})”).Value.ToString

Cheers @A_Learner

@Palaniyappan
This would not work, I provided only part of the file. There are multiple dates in the file. I need to extract the date between those two specific lines.

Thank you,

Hi,

Try to use below steps

  1. Read the Text File: Use the Read Text File activity to read the content of the file into a string variable, let’s call it fileContent.

2.:Use Regular Expressions: You can use regular expressions (Regex) to extract the date between the lines that contain “Total Amount Due” and “Date Extension\grace period”.

extractedDate = System.Text.RegularExpressions.Regex.Match(fileContent, “Total Amount Due[\s\S]*?(\b\w+ \d{2}, \d{4}\b)”).Groups(1).Value

I couldn’t find any statement relevant to this in Ur first post
Would recommend to keep ur question clear

Can we have some strings
Between which two lines u want @A_Learner

Using regex look behind and look ahead worked for this.
Thanks for the suggestions.

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