Re: Q on Regular Expressions

From: Date: Wed, 17 Sep 2003 21:49:01 +0000
Subject: Re: Q on Regular Expressions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-162936@lists.php.net to get a copy of this message
Thanks for the pointer, but this only deals with date/time in EPOCH range. I'm trying to handle dates pre-epoch. Thanks Walter "Curt Zirzow" <php-general@zirzow.dyndns.org> wrote in message news:20030917211347.GF4251@bagend.shire... > * Thus wrote jsWalter (jsWalter@torres.ws): > > I have a fairly complicated regular expression that was written for perl. > > > > I've spent the last 4 days trying to convert it to PHP. > > have you looked at strtotime()? > http://php.net/strtotime > > The Date formats it can find are defined here: > http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html > > > Those regex's look like a nightmare, like they usually do :) > > > > > # Does input match this RegEx? > > > > (($day,$mon,$yr,$hr,$min,$sec,$tz) = > > /^ > > (\w{1,3}) # month > > \s+ > > (\d\d?) # day > > \s+ > > (\d\d?):(\d\d) # hour:min > > (?::(\d\d))? # optional seconds > > \s+ > > (?:([A-Za-z]+)\s+)? # optional timezone > > (\d+) # year > > \s*$ # allow trailing whitespace > > /x) > > > > > Curt > -- > "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#162936) next »