$ perl -lwe '"abbbbc"=~/(b+)/ && print "Found: $1"' Found: bbbb $ perl -lwe '"abbbbc"=~/(b*)/ && print "Found: $1"' Found: