I'd approach it inside out. I'd make my regex try to match like so:
("1" x $money) =~ /^(1{10}|1{6}|1{5}|1{1}){1,}?$/
Then I'd add to that regex code blocks that store the "winning" combination. The concept is, it tries to match the string using only one coin. Once that fails, it tries to match it using two coins. Etc. This is probably slow.
Hrm, this probably won't work easily with Perl's regexes. My first efforts have proved fruitless.
_____________________________________________________
Jeff
japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and
perl
hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart