Re: regex match problem

From: Date: Wed, 14 Aug 2002 18:32:00 +0000
Subject: Re: regex match problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-112588@lists.php.net to get a copy of this message
To Match: Tue, Jul 29, 2003 > $pregmatchstring="/([\s])*(Renewal\DDate|Registered\sthrough|Expires|Record >\sExp ires|Domain\sExpires|Expiry\sDate)([\D\s]*)(.*)/i"; You can change the last part of $pregmatchstring in: ........Expiry\sDate)([\D\s]*|\w{3},\s\w{3}\s\d{2},\s\d{4})(.*)/i"; You can feed this match also to strtotime(). See: <?php $testdate='works: Tue, Jul 29, 2003 works'; $pregmatchstring="/(.*)(\w{3},\s\w{3}\s\d{2},\s\d{4})(.*)/i"; preg_match($pregmatchstring,$testdate,$matches); echo strtotime($matches[2])-strtotime('29 July 2003'); ?> this will echos zero, zo i think it works.

« previous php.general (#112588) next »