in reply to need help to split list
As a one-liner
@a=map{m[(\d+)([a-z]?)-(\d+|[a-z])]and$2?(map{$1.$_}$2..$3):($1..$3)}s +plit',',$s; print "@a"; 1 2 3 4 5 6a 6b 6c 6d 6e 10 11 12 13
Update: The above completely misses the 7!
Corrected and expanded for a little more clarity
"Think for yourself!" - Abigail
Hooray!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: need help to split list
by sgifford (Prior) on Oct 24, 2003 at 22:21 UTC | |
|
Re: Re: need help to split list
by Anonymous Monk on Oct 25, 2003 at 10:49 UTC |