in reply to (Golf) Rangify Array
# 27 * 3 - 1 = 80 chars sub num2range { #23456789012345678901234567 my$x=join',',sort{$a-$b}@_; $x=~s/(?<!\d)(\d+)(?:,((??{ $++1})))+(?!\d)/$1-$+/g;$x }
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (Golf) Rangify Array
by kilinrax (Deacon) on Sep 27, 2001 at 21:00 UTC | |
by japhy (Canon) on Sep 27, 2001 at 21:09 UTC |