Re: Regular expressions problem

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

 



* Khorosh Irani <khorosh@xxxxxxxxx>:
> For example I want to math this stream:
> 123 mm  334
> What is the pattern that math with this stream?

Depends on what regexp function you use, what exactly you want to match,
and whether or not you want to know, after you match, any of the
segments. Rasmus has given you one possible pattern that works with the
ereg functions. If you wanted to use a preg function and wanted to match
3 digits, a space, two m', one or more spaces, and 3 digits, you would
use:

    preg_match('/^\d{3} mm\s+\d{3}$/', $string);

But, what it all comes down to is: you need to determine what PATTERN
you need to be able to match. Once you know that, you can write the
regexp.

> On 4/29/05, Malcolm Mill <malcolm.mill@xxxxxxxxx> wrote:
> > What is it you want to do?
> > 
> > On 4/29/05, Khorosh Irani <khorosh@xxxxxxxxx> wrote:
> > > Hello
> > > I have a question:
> > > What is in the role of space in the regular expressions (POSIX)?

-- 
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