Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Simple regex should match number

by Anonymous Monk
on Feb 01, 2012 at 07:58 UTC ( [id://951142]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://951142]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found