[http://url.com](Here is a link to explain.)
What regex would replace this with:
<a href="http://url.com">Here is a link to explain.</a>
?
str.replace(/\[(\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])\]/ig, "<a href='$1'>$1</a>")
This makes [http://url.com]
become a link with http://url.com
as the text, but I need to have the text be replaced inside ()
.