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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Rory Browne <rory.browne@xxxxxxxxx>:
> > 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@xxxxxxxxxx         | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux