Return each number from a group of numbers
Perl 25 26 25

$_ is the sequence string

s/-/../g;$_=join",",eval


Sample session:

[~/] $ perl -M5.010 -pe 's/-/../g;$_=join",",eval' &lt;&lt;&lt; "1,3-5,9,16,18-23"
1,3,4,5,9,16,18,19,20,21,22,23


Added 1 character to the character count for the -n-p option (thanks Gareth, ..kinda).