Extract only dates from a string using Matches activity

I want to extract only dates from the below given string. I am using the below regex, but it is matching the last number also including dates. Can someone please help me out from this to extract only those two dates as a collection.
Input String: “The dates are 09‑29‑2020 - 08‑13‑2021, Schedule B40R, $0.00, 0953925650”
Regex I tried is: \d{1,2}.\d{1,2}.\d{1,4}

Note: I need only dates to be extracted as a collection.

1 Like


Try with this expression


Hope this would help you resolve this

Cheers @Harsha_Vemula


Your pattern was using . as seperator but did not escaped it. So dot was interpretated as any char

The used seperator is a hyphen

ensure also that along the normal hyphen also the long hyphen is incorporated in case it can occur:

1 Like

Perfect! Thanks a lot for your help @Palaniyappan and @ppr . It resolved my problem and working as expected.

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