In string containing a lot of following url token -
[http://www.someurl.com/path/to/resource/?some=params&crazy_chars=true_0_1_0_1]
Which I want to capture and convert to
<a href="http://www.someurl.com/path/to/resource/?some=params&crazy_chars=true_0_1_0_1" target="_blank" class="exturl">http://www.someurl.com/path/to/resource/?some=params&crazy_chars=true_0_1_0_1</a>
So all the urls inside square bracket would be search and replaced by inline url to element. Current I found Regex for URL pattern as -
RegExp("\[(http|ftp|https)://[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?\]", "gi");
But I am still not clear on how I can do it in single pass. Do I have to loop for till no matcher is found?
http://example.iana.org/]is a valid URL. So ishttp://example.iana.org/[foo]