3. credit card number should only contain 16 characters
if ($creditcard =~ /^\d{16}$/) ...Assume no space in the credit card number. Otherwise a simple check to strip out the space.
Actually, for CC validation, use Buisness::CreditCard. A CC num isn't necessiarily 16 digits (it changes between companies), the first few digits identify the company, and the last digit is a checksum. Buisness::CreditCard will look at all these things for you.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
In reply to Re: Re: Audrey Fong
by hardburn
in thread Need help with regexes to validate user input
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |