| 
 Posted by brendan on 09/13/05 18:49 
Hi ... want to antispam any email address that is written in a page, so long 
as it is not already contained in a hyperlink ie 'mailto:user@email.com' 
 
so am trying to use a negative look behind but I can't get it to work 
 
preg_replace('/(?<!mailto)(([_\\.0-9a-z-]+)@([_\\.0-9a-z-]+))/i', 
"<script>document.write('<a 
href=\'mailto:'+'\\1'+'@'+'\\2'+'\'>'+'\\1'+'@'+'\\2'+'</a>');</script>",$st 
ring ); 
 
doesn't ignore strings starting with mailto (have also tried using 
'mailto\\:'
 
[Back to original message] 
 |