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@em ail.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>docume nt.write('<a
href=\'mailto:' +'\\1'+'@'+'\\2 '+'\'>'+'\\1'+' @'+'\\2'+'</a>');</script>",$st
ring );
doesn't ignore strings starting with mailto (have also tried using
'mailto\\:'
as it is not already contained in a hyperlink ie 'mailto:user@em ail.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>docume nt.write('<a
href=\'mailto:' +'\\1'+'@'+'\\2 '+'\'>'+'\\1'+' @'+'\\2'+'</a>');</script>",$st
ring );
doesn't ignore strings starting with mailto (have also tried using
'mailto\\:'
Comment