diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php
index f2c8e4988..1b1f3efb8 100644
--- a/e107_handlers/e_parse_class.php
+++ b/e107_handlers/e_parse_class.php
@@ -1465,11 +1465,12 @@ class e_parse extends e_parser
case "url":
- $linktext = (!empty($textReplace)) ? $textReplace : '\\2';
- $external = (!empty($opts['ext'])) ? 'rel="external"' : '';
+ $linktext = (!empty($textReplace)) ? $textReplace : '$3';
+ $external = (!empty($opts['ext'])) ? 'target="_blank"' : '';
- $text = preg_replace("#(^|[\s]| )([\w]+?:\/\/(?:[\w-%]+?)(?:\.[\w-%]+?)+.*?)(?=$|[\s[\]<]|\.\s|\.$|,\s|,$| )#is", "\\1".$linktext."", $text);
- $text = preg_replace("#(^|[\s])((?:www|ftp)(?:\.[\w-%]+?){2}.*?)(?=$|[\s[\]<]|\.\s|\.$|,\s|,$)#is", "\\1".$linktext."", $text);
+ $text= preg_replace("/(^|[\n \(])([\w]*?)([\w]*?:\/\/[\w]+[^ \,\"\n\r\t<]*)/is", "$1$2".$linktext."", $text);
+ $text= preg_replace("/(^|[\n \(])([\w]*?)((www)\.[^ \,\"\t\n\r\)<]*)/is", "$1$2".$linktext."", $text);
+ $text= preg_replace("/(^|[\n ])([\w]*?)((ftp)\.[^ \,\"\t\n\r<]*)/is", "$1$2".$linktext."", $text);
break;