T.J. Mather [mailto:[EMAIL PROTECTED]] wrote:
> However it doesn't work if you apply a non-greedy substitution operator on
> the scalar.

You mean "global", not "greedy"

Two snippets from the perl documentation:

s/PATTERN/REPLACEMENT/egimosx

Options are:
    e   Evaluate the right side as an expression.
    g   Replace globally, i.e., all occurrences.
    i   Do case-insensitive pattern matching.
    ....

-- and --

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
    ....

David



Reply via email to