Finally that should be better.my $data = 'NCC045-071-109-SCC021-087-091-011545-'; my $state; while ($data =~ m/([A-Z]+)?(\d+)/g) { last if (length($2) == 6); $state = $1 unless (! defined $1); print $state, $2, ' '; }
In reply to Re: A string parsing question
by Sifmole
in thread A string parsing question
by LordAvatar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |