Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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
Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2016-05-24 07:19 GMT
Find Nodes?
    Voting Booth?