my $str = "1"; if ($str =~ m/-?\p{Nd}/){ print "Matches\n"; } else { print "Doesn't match\n"; } __END__ Doesn't match
What does work in 5.12.2 (and I assume 5.10) is adding a quantifier, say m/-?\p{Nd}{1}/
In reply to Re: Simple regex should match number
by Anonymous Monk
in thread Simple regex should match number
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |