|
Posted by brendan on 09/13/05 17:18
"Oli Filth" <catch@olifilth.co.uk> wrote in message
news:1126616413.069389.128200@g44g2000cwa.googlegroups.com...
> brendan wrote:
> > Want to encode plain email addresses but NOT email addresses in
hyperlinks
> > therefore regex match email addresses that dont have 'mailto:' at
begining
> > ... however can't seem to quite get it to work.
> Read about negative assertions in the PHP manual regex syntax page:
> http://www.php.net/manual/reference.pcre.pattern.syntax.php.
>
hmmm, I did that but no luck, I understand the concept from perl, but I
can't seem to tranlate it to working PHP code
i.e -
return preg_replace('/(?<!mailto)([_\\.0-9a-z-]+)@([_\\.0-9a-z-]+)/i',
"<script>document.write('<a
href=\'mailto:'+'\\1'+'@'+'\\2'+'\'>'+'\\1'+'@'+'\\2'+'</a>');</script>",$st
ring );
chokes.
b.
Navigation:
[Reply to this message]
|