Hi all,
I'm trying to write a regular expression to convert pseudo-ubb markup into HTML, and failing miserably. my RE's arent that strong (obviously) and I've tried so many variations on this its not even funny. Can someone help?
The pseudo UBB is in the form [link=http://www.url.com] or [link=www.url.com], and i want to turn it into a normal HTML hyperlink.
This is the regExp I've got so far:
$txt = preg_replace("(\[link=http://)(.*)(\])","<a href=\"http://\2\" target=\"externallink\">",$txt);
$txt = preg_replace("(\[link=)(.*)(\])","<a href=\"http://\2\" target=\"externallink\">",$txt);
But it fails miserably.
Can anybody point me in the right direction here?
TIA,
kerin