Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Is there a more functional regex syntax?

by rjt (Deacon)
on Sep 18, 2012 at 15:54 UTC ( #994306=note: print w/replies, xml ) Need Help??


in reply to Is there a more functional regex syntax?

I'm not exactly sure the expected output is for the cases where there is only one digit. I took a guess that the min = max in these cases, so if there is no second number, I use the first again.

s|^(\d+)(\-(\d+))?$|$total_min += $1; $total_max += $3//$1|e for (@r +anges);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994306]
help
Chatterbox?
[marto]: My German is very limited and Google translate really isn't helping with that one :P

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2018-01-19 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (218 votes). Check out past polls.

    Notices?