Your regex is fine, though it could be said more economically. The problem is that you don't assign the results of a match to a list or array, my @nums = $split[1] =~ /^(\d{10})(\d{10})(\d{10})$/; Your substitution is throwing away the second two numbers.
Since you have fixed-width fields and no seperators, unpack seems natural. my @nums = unpack 'a10 a10 a10', $split[1]; You know the format of the fields, so you really shouldn't have to worry about whether they are digits (Assuming you don't have to detect bogus data).
After Compline,
Zaxo
In reply to Re: Regexp to extract groups of numbers
by Zaxo
in thread Regexp to extract groups of numbers
by neilh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |