Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: validating numerical field

by boo_radley (Parson)
on Dec 03, 2002 at 21:51 UTC ( [id://217361]=note: print w/replies, xml ) Need Help??


in reply to validating numerical field

see perlre and the section on standard quantifiers.

#! perl -l for my $pw (("12345678901","123456789012","1234567890123","whoa")) { print "$pw is ",&validpw ($pw)?undef:"not ", "valid"; } sub validpw { return $_[0]=~/^\d{11,12}$/; }

Log In?
Username:
Password:

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

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

    No recent polls found