in reply to Regex not behaving as expected
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex not behaving as expected
by Popcorn Dave (Abbot) on Feb 01, 2003 at 00:48 UTC |