if( $input =~ m/^(SR\d{7})$/ ) { print "User entered $1: OK.\n"; } else { print "Invalid input.\n"; }
Have a look at perlretut.
Dave
In reply to Re: validate a form field with regexp?
by davido
in thread validate a form field with regexp?
by raggmopp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |