Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Practical e-mail address validation

by tye (Sage)
on Sep 13, 2008 at 06:25 UTC ( #711061=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $letter =    q<[a-zA-Z]>;
    my $letdig =    q<[a-zA-Z0-9]>;
    my $ldh =       q<[-a-zA-Z0-9]>;
    my $label =     "$letter(?:$ldh*$letdig)?";
    my $domain =    "$label(?:\.$label)*";
    
  2. or download this
    my $label =     "$letdig(?:$ldh*$letdig)?";
    my $domain =    "$label(?:\.$label)*\.$letter{2,}";
    
  3. or download this
    my $atext =     q<[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]>;
    # or $atext =    q<[-\w!#$%&'*+/=?^`a-z{|}~]>;
    ...
    my $atom =      "$atext+";
    my $dot_atom =  "$atom(?:.$atom)*";
    my $addr_spec = $dot_atom . '@' . $dot_atom;
    
  4. or download this
    my $addr_spec = qr/^$dot_atom\@$domain$/;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://711061]
Approved by SankoR
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2021-10-26 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (90 votes). Check out past polls.

    Notices?