Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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?

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 sunlight beams...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2017-02-22 01:04 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (322 votes). Check out past polls.