in reply to regex greedy range

Thanks. The reason I titled it as "greedy range" is that I thought {2,4} will stop as soon as it matched 2 instances, I guess everything is greedy unless explicitly stated otherwise. Well, I should have just tried it, PM is making me lazier. Thanks.

Replies are listed 'Best First'.
Re^2: regex greedy range
by ikegami (Patriarch) on Sep 16, 2004 at 23:55 UTC

    Correct, everything is greedy unless you add the '?'.
    greedy: a?, a*, a+, a{m,n}
    !greedy: a??, a*?, a+?, a{m,n}?