LPM: Regexps for email.

Mike Andrews mandrews at bit0.com
Wed Jan 26 18:29:18 CST 2000


Not that this really answers the question, but I'm a little wary of using
mailto: URL's *anywhere* anymore.  The instant you put an email address on
a web page as-is is the same instant you get added to a pile of spammer's
lists.  Most of them use web-crawling bots to harvest addresses.  We've
got an amusing Apache mod_rewrite + Perl script combo that defeats most of
them here...

Just something to think about.

http://www.turnstep.com/Spambot/avoidance.html has some interesting
suggestions for getting around it -- keeping the email address out of the
HTML source but still have the page look and work the same.  Javascript,
creative use of tables, putting the address into a .gif, and so on...


Mike Andrews (MA12) * mandrews at dcr.net * http://www.bit0.com/
VP, sysadmin, & network guy, Digital Crescent Inc, Frankfort KY
Internet services for Frankfort, Lawrenceburg, Owenton, Shelbyville
"Don't sweat the petty things, and don't pet the sweaty things."

On Wed, 26 Jan 2000, 0x29A [B.Vandgrift] wrote:

> 
> I'm working on a script which goes through a link library I have and
> throws down mad links.  I'm having a problem with my email nonsense.
> 
> ideally, I'd like this bit of the program to take something like:
> --
> here is an email address:booberry at io.com
> --
> and turn it into:
> --
> here is an email address:<a
> href="mailto:booberry at io.com">booberry at io.com</a>
> --
> 
> I am using the following rexexp:
> $inline =~ s/\b(\w+\@\w+(\.\w+)*\.\w+)\b/<a href=\"mailto:$1\">$1<\/a>/g;
> 
> The problem is, it continues matching on the line.  Hence, I get three
> nested requests.  Cool, but not useful.  How can I tell the regexp engine
> not to attempt a match on the text that it just inserted?
> 
> Suggestions, comments, etc?  They'd all be greatly appreciated.
> 
> Thanks
> 
> 
> -- 
> Ben Vandgrift <booberry at io.com>              http://www.io.com/~booberry
> ________________________________________________________________________
> "I do not feel obliged to believe that the same God who has endowed us
>  with sense, reason, and intellect has inteded for us to forego their
>  use."                                                       --Galileo
> 






More information about the Lexington-pm mailing list