in reply to [Solved] Converting a list of numbers to use a range operator
This probably belongs to the obfuscation section, but I was wondering whether there would be a s/// expression that one could apply to "2,3,4,8,10,11,12,13,14,15" repeatedly until it becomes "2-4,8,10-15"?
Any ideas?
To clarify, the expression would create a series of strings like this or similar:
"2,3,4,8,10,11,12,13,14,15" "2-4,8,10,11,12,13,14,15" "2-4,8,10-12,13,14,15" "2-4,8,10-13,14,15" "2-4,8,10-14,15" "2-4,8,10-15"
I hope this will not throw this thread of track...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Converting a list of numbers to use a range operator
by AnomalousMonk (Archbishop) on Mar 24, 2013 at 00:28 UTC |