They are greedy, but not too clever
The quantifiers are greedy, but they refuse to let go of something they found unless forced even if they could get more someplace later.my $str = "xaxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; $str =~ /(a+)/; print "$1\n"; # prints "a" not "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Jenda
Enoch was right!
Enjoy the last years of Rome.
In reply to Re^3: String Matching
by Jenda
in thread String Matching
by stevbutt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |