Aug. 23, 2004, 07:54 PM
I am Perl programmer. But i still can't understand Prox text matching rules. Please read a quote from Perl documentation:
Quote: The following standard quantifiers are recognized:How does Prox behave. Are quantified subpatterns 'greedy' or 'greediness'?
* Match 0 or more times
+ Match 1 or more times
? Match 1 or 0 times
{n} Match exactly n times
{n,} Match at least n times
{n,m} Match at least n but not more than m times
(If a curly bracket occurs in any other context, it is treated as a
regular character. In particular, the lower bound is not optional.) The
"*" modifier is equivalent to "{0,}", the "+" modifier to "{1,}", and
the "?" modifier to "{0,1}". n and m are limited to integral values less
than a preset limit defined when perl is built. This is usually 32766 on
the most common platforms. The actual limit can be seen in the error
message generated by code such as this:
$_ **= $_ , / {$_} / for 2 .. 42;
By default, a quantified subpattern is "greedy", that is, it will match
as many times as possible (given a particular starting location) while
still allowing the rest of the pattern to match. If you want it to match
the minimum number of times possible, follow the quantifier with a "?".
Note that the meanings don't change, just the "greediness":
*? Match 0 or more times
+? Match 1 or more times
?? Match 0 or 1 time
{n}? Match exactly n times
{n,}? Match at least n times
{n,m}? Match at least n but not more than m times