in reply to Re: Is there a more functional regex syntax?
in thread Is there a more functional regex syntax?
Or more simply, if you want to keep the variables separate,$totals[$_] += ($range =~ /^(?=(\d+))(?:\d+-)?(\d+)$/)[$_] for 0,1;
$total_min += ($range =~ /^(\d+)/)[0]; $total_max += ($range =~ /(\d+)$/)[0];
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Is there a more functional regex syntax?
by smls (Friar) on Sep 18, 2012 at 17:14 UTC | |
by kennethk (Abbot) on Sep 18, 2012 at 17:35 UTC |