Hi,
Can anybody help me with the following expression. I am trying to replace an email address in body text with a link.
<?php
$str = preg_replace('#(.*)\@(.*)\.(.*)#','<a href="mailto:\\1@\\2.\\3">\\1@\\2.\\3</a> ',$str);
?>
This seems to work fine when replacing an email address on its own but when text follows, it includes the text in the link. If I place a break after the email address again it works.
Please help.
JimFl
Can anybody help me with the following expression. I am trying to replace an email address in body text with a link.
<?php
$str = preg_replace('#(.*)\@(.*)\.(.*)#','<a href="mailto:\\1@\\2.\\3">\\1@\\2.\\3</a> ',$str);
?>
This seems to work fine when replacing an email address on its own but when text follows, it includes the text in the link. If I place a break after the email address again it works.
Please help.
JimFl