Can some one explain this to me ?

Code:
$rg_link_http = "h(ttps?://" . $rg_url . ")";

$CON = preg_replace('#\[([^\]]+)\|' . $rg_link_http . '\]#U', '<a href="xx$2" class="url">$1</a>', $CON);
I know this is parsing the line:

Code:
[Google|http://www.google.com]
to html code :

Code:
<p><a href="http://lionwiki.0o.cz" class="url">LionWiki</a> </p>
But what if I want to add another variable so that if it exists, it will add it to the variable ?

So, if I wanted the to give

Code:
[Google|http://www.google.com|onMouseover="ddrivetip('Visit this google page')"; onMouseout="hideddrivetip()]
It will make the link like this:

Code:
<a href="www.google.com" onMouseover="ddrivetip('Visit this google page')"; onMouseout="hideddrivetip()">Search Engine</a>
as you can see it just added the third variable parsed by | to the href tag.


It can be done with just one line but I dont know how - Please help