I'm using a regular expression to turn URLs in blog comments into clickable hyperlinks. However, i also want to do the opposite:
Since i allow certain html tags (but not <a>
), if somebody types in a hyperlink, i'd like to change it from:
<a href="http://www.example.com">My Link</a>
into
My Link: http://www.example.com
where the generated code is:
<p><b>My Link:</b> <a href="http://www.example.com" rel="nofollow">http://www.example.com</a></p>
Thanks!