I am having an issue with using regex to extract URLs from a text and then modifying all the matches within the replacement string using a function. Below is a simplified example of what I am trying to accomplish. Is it possible to achieve something like this?
var exp = /\b((http:\/\/|https:\/\/)[\S]*)/g;
text = text.replace(exp, "<a href=\"$1\" title=\""+parseUri("$1").host+"\"></a>");