Changeset 66

Show
Ignore:
Timestamp:
06/06/01 05:12:33
Author:
schwern
Message:

Allowing a space between the local part, @ and the domain as implied
in the RFC.

Using study(), what the hell.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Email-Find/trunk/lib/Email/Find.pm

    r45 r66  
    5858# Finally, the address-spec regex (more or less) 
    5959use vars qw($Addr_spec_re); 
    60 $Addr_spec_re = qr/$Local_part_cheat_re\@ 
    61                        (?:$Domain_ref_cheat_re| 
    62                           $Domain_literal_cheat_re) 
    63                   /x; 
     60 $Addr_spec_re = qr/$Local_part_cheat_re\ ?\@\ ? 
     61                        (?:$Domain_ref_cheat_re| 
     62                           $Domain_literal_cheat_re) 
     63                   /x; 
     64 
     65 
    6466 
    6567my $validator = Email::Valid->new('-fudge'      => 1, 
     
    7375 
    7476    my $emails_found = 0; 
     77 
     78    study($$r_text); 
    7579 
    7680    $$r_text =~ s{($Addr_spec_re)}{ 
     
    206210Alas, many things which aren't email addresses I<look> like email 
    207211addresses and parse just fine as them.  The biggest headache is email 
    208 and usenet message IDs.  I do my best to avoid them, but there's only 
    209 so much cleverness you can pack into one library. 
     212and usenet and email message IDs.  I do my best to avoid them, but 
     213there's only so much cleverness you can pack into one library. 
    210214 
    211215=back 
     
    219223 
    220224Thanks to Jeremy Howard for his patch to make it work under 5.005. 
     225 
    221226 
    222227=head1 LICENSE