Re: The difference between ereg and preg?
| From: | Robert Cummings | Date: | Sun, 06 Aug 2006 02:50:55 +0000 |
| Subject: | Re: The difference between ereg and preg? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-240194@lists.php.net to get a copy of this message | ||
On Sun, 2006-08-06 at 10:39 +0900, Dave M G wrote:
> Robert,
>
> Thank you for replying.
> >
> > Check out the greediness modifier. Greediness determines whether it
> > extends the matching to the largest possible match or the smallest
> > possible match. By default regexes are greedy.
>
> By "greediness modifier", do you mean the preg_set_match, the
> preg_set_order, and preg_pattern_order arguments?
>
> The documentation on the PHP site does mention the term "greedy", but to
> me it's not very clear about explaining which modifiers are responsible
> for which behaviour.
>
> I've experimented with each, and to me it seems like they all behave the
> same, so perhaps "greediness" is determined by some other modifier?
RTFM ;)
http://ca.php.net/manual/en/reference.pcre.pattern.modifiers.php
Search for greedy or more specifically ungreedy :)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'