Using delimiter "space" in making a link with a custom tag of <url>

$myString="I often visit <url></url> and love it.";

'<a href="http://$1">http://$1</a>',

echo $myString;


I often visit 
<a href="http://[COLOR="blue"][/COLOR]">[COLOR="Red"][/COLOR]</a> 
and love it.

The code above works fine with the result above.

I like to make it like the following.

if there is any space between <url> and </url>, the string which is after the first space will be the link title.

The would-be code and my target result will be like the following.

[b]would-be code[/b]

$myString="I often visit 
<url>[COLOR="blue"][SIZE="7"]s[/SIZE][/COLOR] [COLOR="Red"][SIZE="7"]s[/SIZE]itepointForums[/COLOR]</url> 
and love it.";

'<a href="http://$1">[COLOR="Red"]$afterSpace[/COLOR]</a>', $myString); 

[b]target result[/b]

I often visit 
<a href="http://[COLOR="Blue"][/COLOR]">[COLOR="red"]sitepointForums[/COLOR]</a> 
and love it.

$myString="I often visit <url> Sitepoint Forums</url> and love it.";

$myString=preg_replace('/<url>(.*?) (.*?)<\\/url>/s', 
'<a href="http://$1">$2</a>',

echo $myString;

// I often visit <a href="">Sitepoint Forums</a> and love it.

Had to escape the / here <\/url>

Thank you very much, Cups.
Your code works fine.