How to identify a date in a portion of the text

Hi to all,
I need a little help understanding how to identify a date in the subject of an email.
After scraping from a mailserver, I get output like this:
23-05-2024 Da: com
22-05-2024 Da: dip
21-05-2024 Da: dip
21-05-2024 Da: dipps0
17-05-2024 Da: dipps

Before the date there are 3 blank spaces and after the date, 2 blank spaces.
But I fear that this structure is variable, so perhaps not always especially in the head, the 3 empty spaces will be present.
How can I extract only the date?
Thanks to all…
Aaron

Hi @AaronMark

Try this

\d+\-\d+\-\d+

Regards,

@AaronMark

Input = "23-05-2024 Da: com"
Output = System.Text.RegularExpressions.Regex.Match(Input,"(\d+\-\d+\-\d+)").Value

Hi @AaronMark

Try below expression in Assign Activity

System.Text.RegularExpressions.Regex.Match("23-05-2024 Da: com","\d{2}-\d{2}-\d{4}").Value

Happy Automation :slight_smile:

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