in reply to Must do regex range quantifier { } as a greedy

https://perldoc.perl.org/perlre#Quantifiers

{n,m}+ Match at least n but not more than m times and give nothing back

  • Comment on Re: Must do regex range quantifier { } as a greedy

Replies are listed 'Best First'.
Re^2: Must do regex range quantifier { } as a greedy
by LanX (Saint) on Jan 17, 2022 at 12:05 UTC
    The relevant part is rather

    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 "?"

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery