in reply to matching every occurrence of a regex
while (<DATA>) { next if /^\s+$/; my (undef,$pos,undef) = split; print "$pos\n"; } __END__ BC001593 91 NPSL BC001593 262 NASS BC001593 293 NAST
Second, I can find nothing wrong with your regex above, which gives me the correct output when I enclose it in a loop similar to the one above:
Therefore, I suggest that there is something wrong with your looping structure, rather than your regex.while (<DATA>) { next if /^\s+$/; my $sites = 0; if (/\w{1,12}\s+(\d{1,5})\s+[a-zA-Z]{4}/sm){$sites = $1} print "$sites\n"; } __END__ BC001593 91 NPSL BC001593 262 NASS BC001593 293 NAST
I hope this helps.
--
Regards,
Helgi Briem
helgi AT decode DOT is
|
|---|