I've a problem with some regex to grab url's from a text and modify all matches inside the replacement string again by a function. The code below is a dummy example of what I want do to. Is something like this possible?
var exp = /\b((http:\/\/|https:\/\/)[\S]*)/g;
text = text.replace(exp, "<a href=\"$1\" title=\""+parseUri("$1").host+"\"></a>");