| | |
regex not validating email
Thread Solved |
as part of my assignment i'm trying to validate an email address stored in an hash, with the key: 'email' and the value as the data supplied. But the email is not getting validated using reg-ex:
Perl Syntax (Toggle Plain Text)
if($form_element{'email'} =~ m/^[A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{2,4}$/i){ $values = 0; $mail = "InValid!"; } else { $mail = "Valid!"; }
Live free.... Die Hard!
Perl Syntax (Toggle Plain Text)
if($form_element{'email'} =~ m/^[a-zA-Z0-9_\-]+@[a-zA-Z0-9_\-]+([.][a-zA-Z0-9_\-]+)+[a-zA-Z]{2,4}$/i){ $values = 0; $mail = "Valid!"; } else { $mail = "InValid!"; }
![]() |
Similar Threads
- Verify Email Address (ASP.NET)
Other Threads in the Perl Forum
- Previous Thread: insert text
- Next Thread: OLE and Office 2007
| Thread Tools | Search this Thread |





