in reply to Need help with regexes to validate user input
2. email address validationif ($who !~ /[A-Za-z]/) ... # thanks to eric256 to point out the prob +lem if ($who2 !~ /[A-Za-z]/) ... # in my regexp. I really meant to use a n +egative # regexp. If any character not alphabetic +al. ^_^
Ok, what I did was perhaps too simple here. You should really use the Mail::Address module to check/obtain the canonical form of the Email address properly.if ($email =~ /@/) ...
Assume no space in the credit card number. Otherwise a simple check to strip out the space. Thanks to hardburn to point out the credit card checking modules. I was a bit lazy because Audrey Fong only wanted to check if there were 16 digits.if ($creditcard =~ /^\d{16}$/) ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Audrey Fong
by hardburn (Abbot) on Nov 11, 2003 at 15:02 UTC | |
|
Re: Re: Audrey Fong
by eric256 (Parson) on Nov 11, 2003 at 17:45 UTC |