Re: [PHP] preg_match and dates

2009-03-02 Thread Per Jessen
Michael A. Peters wrote: What I'm trying to do is write a preg matches for each case I come across - if it matches the preg, it then parses according to the pattern to get me an acceptable -MM-DD (not sure how I'll deal with the season case yet ... but I'm serious, that kind of thing in

Re: [PHP] preg_match and dates

2009-03-02 Thread Per Jessen
Michael A. Peters wrote: This is what I have so far - $pattern[] = /^([0-9]{1,2})[\s-]([A-Z][a-z]*)[\s-]([0-9]{4,4})$/i; $clean[] = \\3-\\2-\\1; $pattern[] = /^([A-Z][a-z]*)[\s-]([0-9]{4,4})$/; $clean[] = \\2-\\1-01; $foo = preg_replace($pattern, $clean, $verb_date); If I were you, I'd

Re: [PHP] preg_match and dates

2009-03-02 Thread Michael A. Peters
Per Jessen wrote: Michael A. Peters wrote: What I'm trying to do is write a preg matches for each case I come across - if it matches the preg, it then parses according to the pattern to get me an acceptable -MM-DD (not sure how I'll deal with the season case yet ... but I'm serious, that