Reply to Re: Regex help

Your name:

Reply:


Posted by Michael Fesser on 12/18/07 19:38

..oO(Patrick Drouin)

>Hello Michael,
>
>> Nope. What's returned is the entire matched string and all parenthesized
>> sub strings (if there are any), but not every single matching point from
>> during the execution.
>>
>> The above is exactly what you told preg_match() to return:
>
>Well OK, let me rephrase then, how can I tell PHP to match the
>substrings. In my mind, (a+) means a, aa, aaa, ... and not only the
>maximum string. I don't see how that behaviour is logical in any way.

That's how regular expressions work in general. The only thing that you
can control in many regex engines is whether the engine should stop the
matching process after it has found a minimum match (ungreedy) or if it
should continue until the maximum length (greedy), which is usually the
default.

Micha

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация