abcd 723 abcd 724 abcde 552 abcde 554 abcde 553 abcded 756but instead I get :
abcd 723 abcd -724 abcde 552 abcde -554-553 abcdef 756 abcdefThe code:
while ($line=<DATA>) { my @c=($line=~/^(\w+)\t(\d+)((?:-\d+)*)/); my @d=@c[1..$#c]; foreach $e (@d) { print $c[0]," ", $e,"\n"; } } __DATA__ abcd 723-724 abcde 552-554-553 abcdef 756
In reply to regex problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |