Re: [PHP] Regular expressions problem

2005-04-30 Thread Khorosh Irani
For example I want to math this stream:
123 mm  334
What is the pattern that math with this stream?
Thanks

On 4/29/05, Malcolm Mill [EMAIL PROTECTED] wrote:
 What is it you want to do?
 
 On 4/29/05, Khorosh Irani [EMAIL PROTECTED] wrote:
  Hello
  I have a question:
  What is in the role of space in the regular expressions (POSIX)?
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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



Re: [PHP] Regular expressions problem

2005-04-30 Thread Rasmus Lerdorf
Khorosh Irani wrote:
For example I want to math this stream:
123 mm  334
What is the pattern that math with this stream?
Thanks
123[[:space:]]+mm[[:space:]]+334
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Regular expressions problem

2005-04-30 Thread Matthew Weier O'Phinney
* Khorosh Irani [EMAIL PROTECTED]:
 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 [EMAIL PROTECTED] wrote:
  What is it you want to do?
  
  On 4/29/05, Khorosh Irani [EMAIL PROTECTED] 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:[EMAIL PROTECTED] | http://vermontbotanical.org

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



[PHP] Regular expressions problem

2005-04-29 Thread Khorosh Irani
Hello
I have a question:
What is in the role of space in the regular expressions (POSIX)?

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