Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: A function to determine if a string is numeric

by hippo (Bishop)
on May 18, 2020 at 12:19 UTC ( [id://11116897]=note: print w/replies, xml ) Need Help??


in reply to Re^2: A function to determine if a string is numeric
in thread A function to determine if a string is numeric

The documentation explains this.

The various patterns are not anchored. That is, a pattern like $RE {num} {int} will match against "abc4def", because a substring of the subject matches. This is by design, and not a bug. If you want the pattern to be anchored, use something like:
my $integer = $RE {num} {int}; $subj =~ /^$integer$/ and print "Matches!\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-25 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found