Re: preg_match and dates
| From: | Per Jessen | Date: | Mon, 02 Mar 2009 09:22:43 +0000 |
| Subject: | Re: preg_match and dates | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289035@lists.php.net to get a copy of this message | ||
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 YYYY-MM-DD (not sure how I'll deal
> with the season case yet ... but I'm serious, that kind of thing in
> there several times)
>
> To at least get started though, is there a wildcard defined that says
> match a month?
>
> IE
>
> /^([0-9]{2})[\s-](MONTH_MATCH)[\s-]([0-9]{4,4}$/
>
> where MONTH is some special magic that matches Mar March Apr April
> etc. ?
Just write one yourself.
--
Per Jessen, Zürich (6.1°C)