[Cascavel-pm] Regexp "greediness" (era: Quando *não* usar Perl?)
Nelson Ferraz
nferraz em gmail.com
Segunda Janeiro 29 08:17:40 PST 2007
Fernando Oliveira wrote:
> o ? indica o minimo... ele vai pegar a menor qtidade de caracteres q
> caiba na expressão...
De acordo com a documentação (perlre): "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 "?"."
Para saber mais:
perldoc perlre
perldoc perlrequick
perldoc perlretut
OBS - O perlrequick já foi traduzido! :)
http://www.perl.org.br/bin/view/Perldoc/Perlrequick
Mais detalhes sobre a lista de discussão Cascavel-pm