You are here: regex negative look behind not working « PHP Programming Language « IT news, forums, messages
regex negative look behind not working

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\\:'

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация