Saladino has asked for the wisdom of the Perl Monks concerning the following question:
And this apparently works.$line =~ s/\n|\r//g;
Which looks like it should match version number, but it doesn't.my($version) = $line =~ m/^Version:\s(\d+)$/;
And i don't understand why moving the \s from inside the selection to outside causes the refexp to fail.my($version) = $line =~ m/^Version:(\s\d+)$/;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Can't match my regex
by Marshall (Canon) on Sep 04, 2009 at 23:00 UTC | |
Re: Can't match my regex
by ww (Archbishop) on Sep 05, 2009 at 00:47 UTC | |
by Saladino (Beadle) on Sep 05, 2009 at 09:49 UTC | |
Re: Can't match my regex
by Melly (Chaplain) on Sep 07, 2009 at 09:44 UTC | |
Re: Can't match my regex
by Anonymous Monk on Sep 08, 2009 at 14:58 UTC |