I'm writing program that replace link with bbcode. I need a regex that replace url with bbcode, example:
before
http://mediafire.com/abc (or http://dropbox.net/abc,...)
I want to filter that name of link also
after
[url=http://name-of-link.com/abc]http://name-of-link.com/abc[/url]
This is what I have got so far:
Search for:
(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?
Replace with:
[url=$1]$2[/url]
But it seems doesn't work. Hope anyone can help me out this issue. Thank you.
Edit:
My issue that I want to filter name of link also, because I don't want to replace link of image to bbcode.