I do not know how to better track down the question. What I want to do is to look for every e-mail-address matching my regEx in different div.test, to create <a href="mailto:"> links.
This does work, but if there are multiple mail addresses inside one div, only the first one gets highlighted. Whats the problem?
var regEx = /(\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)/;
$(".test").filter(function() {
return $(this).html().match(regEx);
}).each(function() {
$(this).html($(this).html().replace(regEx, "<a href=\"mailto:$1\">$1</a>"));
});
gon the end of your regex..