N. Ganesh Babu wrote:
Dear All,

input:

<aud=1-3>T
<cpn=1-3,4,5,6-10>6
<bnd=1-3>TC

output

<aud=1,2,3>T
<cpn=1,2,3,4,5,6,7,8,9,10>6
<bnd=1,2,3>TC

How can it be achieved in regular expression?. Or any other means is easy.

use Set::IntSpan;

my $set = Set::IntSpan->new('1-3,4,5,6-10');
my @elems = $set->elements;
print join( ',', @elems ), "\n";

__END__


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to