The problem with the way you had it is that it is returning 1 not because of the number 1 in the 013 but because it is true (use strict; my $file = 'file013.txt'; my ($sk) = $file =~ m/0*(\d+)/; print $sk;
-enlil
In reply to Re: Regex not behaving as expected
by Enlil
in thread Regex not behaving as expected
by Popcorn Dave
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |