If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

// pad it with a space so we can match things at the start of the 1st line.$ret = ' ' . $text;

// matches an "xxxx://yyyy" URL at the start of a line, or after a space.// xxxx can only be alpha characters.// yyyy is anything up to the first space, newline, comma, double quote or <$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);

// matches an email@domain type address at the start of a line, or after a space.// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);