in reply to Simple regex should match number

Yup, it works in 5.14.1 but doesn't work in 5.12.2
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}/

Replies are listed 'Best First'.
Re^2: Simple regex should match number
by Anonymous Monk on Feb 01, 2012 at 08:10 UTC