Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: List-to-Range generation

by abjr (Initiate)
on Aug 23, 2011 at 20:07 UTC ( #921991=note: print w/ replies, xml ) Need Help??


in reply to List-to-Range generation

10 years later this is still really cool. I've been using if for a while now and there is one small issue I've seen. If you have a list of numbers, say 1,2,3 ... 39999,40000 and run it through num2range, you'll get the following back: "1-32768,32769-40000" instead of "1-40000".

I'm guessing this is because you can't have more than 32k captures in a regex?


Comment on Re: List-to-Range generation
Re^2: List-to-Range generation
by OfficeLinebacker (Chaplain) on Apr 25, 2013 at 01:13 UTC
    Hmm, just trying to figure out a way to test this is bending my mind. So is this true? This method only works for ranges up to 2^15?

    What if you split up the ranges? It would work for any list of up to 32,768 consecutive numbers, right?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://921991]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (15)
As of 2014-09-23 18:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (234 votes), past polls