Need help in getting date from string

Job Complete Date changed from 12/31/21 00:00 to 12/31/22 00:00 for Job Number A01Z6B4 on Work Request 05789494

Above is the string format and i need to get the date which is the latest one i mean after to. how to get this date.

HI @Puneet_Singh3

Use assign activity

LHS → Create an variable
RHS → System.Text.RegularExpressions.Regex.Match("Input String","(?<=to\s)(\d.{2}\d.{2}\d{2})").Tostring.Trim

Regards
Gokul

If you need to get Date and Time

Try with this expression

Use assign activity

LHS → Create an variable
RHS → System.Text.RegularExpressions.Regex.Match("Input String","(?<=to\s)(\d.{2}\d.{2}\d{2}\s\d+:\d+)").Tostring.Trim

Regards
Gokul

Getting Blank

Can you share exact Input text @Puneet_Singh3

Hi can you show the XAML file screenshot.

In think so there is Whitespace between the data share exact input to provide the expected output @Puneet_Singh3

Regards
Gokul

Job Complete Date changed from 10/30/21 15:00 to 06/30/22 00:00 for Job Number A024SH4 on Work Request 05865714

This is the exact input text which i get and i need to extract date and work request

Use assign activity

LHS → Create an variable
RHS → System.Text.RegularExpressions.Regex.Match("Input String","(?<=Work\sRequest\s)(\d+)").Tostring.Trim

Regards
Gokul

Not working

Can you share the mail subject here @Puneet_Singh3

Hi @Puneet_Singh3

System.Text.RegularExpressions.Regex.Match(MailSubject,"(?<=Work\sRequest\s)(\d+)").Tostring.Trim

MailSubject → Variable You don’t need to put in Double quotes

Regards
Gokul

@Puneet_Singh3

Try This :

regex.Match(Test,"(?<=to )[\d]{2}.[\d]{2}.[\d]{2}").ToString
Screenshot (121)