Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: validate a form field with regexp?

by davido (Archbishop)
on Apr 21, 2012 at 03:42 UTC ( #966301=note: print w/ replies, xml ) Need Help??


in reply to validate a form field with regexp?

if( $input =~ m/^(SR\d{7})$/ ) { print "User entered $1: OK.\n"; } else { print "Invalid input.\n"; }

Have a look at perlretut.


Dave


Comment on Re: validate a form field with regexp?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2016-02-08 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (265 votes), past polls