I'm currently trying to convert this:
[url=http://example.com] this is a link [/url]
to a standard html link:
<a href=http://example.com>this is a link</a>
So far, I can convert the url string to a link, however the [url=] [/url] still remains and I'm not sure how to filter it out.
message.replace(/(\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1'>$1</a>")
How can I filter out the [url=] [/url] in the regex and also ensure this is a link (text defined by the user) also remains?