What should be a regular expression to match the date of any format, for example
26FEB2009 30 Jul 2009 27 Mar 2008 29/05/2008 27 Aug 2009
What should be the regular expression for this?
I have a regex that matches February 26th, 2009 and February 26th, 2009 FEB , but not with 26FEB2009 . Therefore, if anyone knows, please update it.
(?:^|[^\d\w:])(?'day'\d{1,2})(?:-?st\s+|-?th\s+|-?rd\s+|-?nd\s+|-|\s+)(?'month'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[uarychilestmbro]*(?:\s*,?\s*|-)(?:'?(?'year'\d{2})|(?'year'\d{4}))(?=$|[^\d\w])
Date 26FEB2009 is a substring of another string, for example FUTIDX 26FEB2009 NIFTY 0 , and is parsed from an html page, so I can not set a space or a separator.
EDIT Examples:
07.11.2008 Jan 11 2008 May 26 2008 26FEB2009 27 Mar 2008
source share