Re: Re: Can someone help me build a regular expression?

From: Date: Tue, 03 May 2005 16:23:45 +0000
Subject: Re: Re: Can someone help me build a regular expression?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-214375@lists.php.net to get a copy of this message
* Rory Browne <rory.browne@gmail.com>: > > You mite try this. I know that this work with perl. > > > > =~ m/^[0-9][A-Z][a-z]{2-3} \.[0-9]+$/ > > I'm not sure what the initial m does(I'm not a perl person), The 'm' is an optional flag indicating that a 'match' regexp (versus a substitution or transliteration) follows. It's typically only necessary in perl if using delimiters other than / around the regexp. (The person who posted that should have written it as PHP to avoid confusion: preg_match('/^[0-9][A-Z][a-z]{2-3} \.[0-9]+$/', $string);) -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:matthew@garden.org | http://vermontbotanical.org

« previous php.general (#214375) next »