Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://966301]
help
Chatterbox?
choroba still feeling the Erlang hangover

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2017-12-11 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (289 votes). Check out past polls.

    Notices?