forum

Home / DeveloperSection / Forums / Extract a format of date from a string

Extract a format of date from a string

Takeshi Okada 2556 06-Mar-2014

I need to extract a date of birth from a given string. The format is always "ddMMMyy" (for example "22NOV83").

The problem is that there could be other chars before and after the dob. possible inputs are : "DOB: 22NOV83", "CUSTOMER A DOB: 22NOV", "22NOV83 BLA BLA"

I think that by using this Regex:

^\d{2}[a-zA-Z]{3}\d{2}$

I can check if a string mathces a date , But how to check if a part of a string mathces a date and than extract it ?

Any help would be appreciated.


c# c# 
Updated on 06-Mar-2014

Can you answer this question?


Answer

1 Answers

Liked By