How to extract the date from text

Hi,

How to extract the date from given input.

APP was removed from A/C DHC-8-201 on July 10 2019
APP was removed from A/C HHC-9-200 on December 11 2002
APP was removed from A/C CHC-5-101 on June 15 2020
APP was removed from A/C CHC-5-101 on 20 June 2020
APP was removed from A/C CHC-5-101 on 20-June-2020
APP was removed from A/C DHC-8-201 on 2020 April 25
Expected output:
July 10 2019
December 11 2002
June 15 2020
20 June 2020
20-June-2020
2020 April 25
Please help me, how to do this.

Regards,
Lakshmi

HI,

Hope the following sample helps you.

mc = System.Text.RegularExpressions.Regex.Matches(yourString,"(?<=\bon ).*?$",System.Text.RegularExpressions.RegexOptions.Multiline)

Sequence1.xaml (7.0 KB)

Regards,

HI @lakshmi.mp

Checkout this expression

System.Text.RegularExpressions.Regex.Match("Input String","\d{2} \S+ \d{4}$|\S+ \d{2} \d{4}$|\d{2}\-\S+\d{4}$|\d{4} \S+ \d{2}$").ToString

Regards
Sudharsan

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