ID:               24571
 Updated by:       [EMAIL PROTECTED]
 Reported By:      matthewb at syrah dot us
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Irrelevant
 PHP Version:      Irrelevant
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

Added entry to regexp.reference.internal-options (syntax) and link
there (modifiers).


Previous Comments:
------------------------------------------------------------------------

[2003-07-09 19:34:12] matthewb at syrah dot us

Description:
------------
The preg documentation for setting the ungreedy modifier in the middle
of a pattern is unclear on this page:

http://www.php.net/manual/en/pcre.pattern.modifiers.php

In the "U (PCRE_UNGREEDY)" section it says: 

"It [the ungreedy modifier] can also be set by a (?U) modifier setting
within the pattern."

This is confusing.  Why is the "U" inside the parentheses?  Why are the
parentheses even here?  As far as I can tell, neither the parentheses
nor the U have anything to do with using "?" to make a particular
quantifier ungreedy within a pattern.  Specifically, neither /,.*?U,/
nor /,.*(?U),/ seem to make the * ungreedy.

In my opinion, it would be more clear to say:

"The ungreedy modifier can also be applied to individual quantifiers
within a pattern by placing a "?" after the quantifier. For example
/,.*?,/ will ungreedily match characters between the commas."

(Aside: I admit that the effects of the "?" inside patterns is well
documented on this page:

http://www.php.net/manual/en/pcre.pattern.syntax.php

But unfortunately the word "ungreedy", while it does appear on the
page, does not appear near the section describing the ungreedy effects
of "?".)

Many thanks.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24571&edit=1

Reply via email to