in reply to Regex quantifiers composed?

The question mark after a quantifier turns off greeding matching. In your regex it doesn't make much sense though. You're trying to match exactly 5 times, so greedy and non-greedy are the same thing.
/a{1,5}/; # match 1-5 'a's prefer the longest. /a{1,5}?/; # match 1-5 'a's prefer the shortest.
Here is an example:
#!/usr/bin/perl -wT use strict; $_ = 'aaaab'; # greedily match upto 5 'a's followed by a word char print "Greedy: "; print /(a{1,5})\w/, "\n"; # non-greedily match upto 5 'a's followed by a word char print "NonGreedy: "; print /(a{1,5}?)\w/, "\n"; __END__ Greedy: aaaa NonGreedy: a

-Blake