SA Bugzilla – Bug 1091
find_all_addrs_in_line hostname matching rules
Last modified: 2002-12-20 00:08:41 UTC
find_all_addrs_in_line unnecessarily allows a dot in the first hostname component, resulting in backtracking since first all dotted components are matched, then the mandatory dot \. is not matched. Suggested modification: my $ID_PATTERN = '[-a-z0-9_\+\:\/\.]+'; my $HOST_PATTERN = '[-a-z0-9_\+\:\/]+'; while ($line =~ s/(?:mailto:)?\s* ($ID_PATTERN \@ $HOST_PATTERN(?:\.$HOST_PATTERN)+)//oix) { my $addr = $1; next if (defined ($seen{$addr})); $seen{$addr} = 1; push (@addrs, $addr); }
Thanks Klaus, makes sense. now in....
Justin, thanks for accepting this change.