Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
And after running this script the $1 variable will be empty! Why? "*" means ZERO of SEVERAL matchings so it should match at least one number. Or it shouldn't :) ?$string = "qwerty 12345"; $string =~ m/([1-5]*)/; print $1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Search operator and * quantifier
by moritz (Cardinal) on Jun 20, 2012 at 16:29 UTC | |
by Anonymous Monk on Jun 20, 2012 at 16:50 UTC | |
by gg48gg (Sexton) on Jun 21, 2012 at 04:39 UTC | |
by moritz (Cardinal) on Jun 21, 2012 at 07:44 UTC |