in reply to When greedy constructs do battle, can I choose the winner?
But what I'd suggest is just doing
I think that should get you as many digits as possible up to 5 before the trailing 0's, without anyone's lunch money being at risk. :)$running_total =~ s/(\d{0,4}[1-9])0*$/$1/;
|
|---|