Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I expect the string "1" to match the following regex but it doesn't.
my $str = "1"; if ($str =~ m/-?\p{Nd}/){ print "Matches\n"; else { print "Doesn't match\n"; }
I am using Perl v5.10.0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple regex should match number
by repellent (Priest) on Feb 01, 2012 at 07:41 UTC | |
by JavaFan (Canon) on Feb 01, 2012 at 11:51 UTC | |
|
Re: Simple regex should match number
by davido (Cardinal) on Feb 01, 2012 at 07:25 UTC | |
|
Re: Simple regex should match number
by Anonymous Monk on Feb 01, 2012 at 07:58 UTC | |
by Anonymous Monk on Feb 01, 2012 at 08:10 UTC | |
|
Re: Simple regex should match number
by JavaFan (Canon) on Feb 01, 2012 at 11:52 UTC | |
by Anonymous Monk on Feb 04, 2012 at 18:32 UTC | |
by JavaFan (Canon) on Feb 04, 2012 at 20:54 UTC |