Modify regex to match dates with ordinals "st", "nd", "rd", "th" -


How can regex down to match the dates with the serial number on the part of the day be modified? This Reggae coincides with "January 1, 2003 | February 29, 2004 | 2 November, 29 320", but I also need it: "January 1, 2003 | February 29, 2004 | November 02, 3202 | March 3, 2010 "

  ^ (?: (((January (uary)) | Ma (R)? | Y) | July (Y)? | August (Ost)? | October (Ober)? | December (Amber)?) 31 () ((January (uary)) | (R (f)? | Y) | April (IL) |? JU ((?)? (? ) (August) (October) (October) (Amber)? (0? [1- 9] | ([12] \ D) 30) (February (Rਵਰੀ)? \ (0? [1- 9] | 1 \ 2 | [2 | 9] | 8] | [13579] [26]) | ((16 | [ [2 9] \ d) \ d {2} ))  

Thanks.

(1 ) Any month's name or short;
(2) white spot;
(3) any one or two digits;
(4) white space;
( 5) Any cents, ND, RD, th;
(6) white space or comma + alternative white space;
(7) any four digits;

I'm not sure Who are you matching with But if I had January 35, 3001 then I would think that I would capture it again and invalid it

In addition, on the basis of my data set, the case Consider sensitivity issues and common international English forms such as 1 January 2004 or 1 January 2004, or January 2004, etc.

?? y)) | February (? Ruary) | Ma (?: (?:?)? | Y) | a (?: ( ?: IL?) | Ug (?: Ust?)? Sep (?: T | tember)? | Octet (?: Ober)? | (?: Nav | DC) (?: Amber)?) \ S + \ d {1,2} (?: | Nd | Rd | th)? (?: \ S + |, \ s *) \ D {4} \ b

Even more practical (and readable ), when As long as you do not have a very bizarre dataset, then you have to allow anything after the normal prefix:

  (?: Jn | facebook | mr | arr | me | jum | jul | f | SEP | Act | Nava | DC] [Ez] *? \ S + \ d {1,2} (?: [Edge] {2})? (?: \ S + |, \ s *) \ d {4} \ b  

Is this match Octangenium 99xx, 0000 ? Yes. Is it likely to be a problem? I doubt it.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -