Users Pricing

forum

Home Forums Extract a format of date from a string – MindStick

Extract a format of date from a string

Takeshi Okada 2986 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.


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md