Мой код:
jQuery.fn.extend({
highlight: function(search){
var regex = new RegExp('(<[^>]*>)|('+ search.replace(/[.+]i/,"$0") +')','ig');
return this.html(this.html().replace(regex, function(a, b, c){
return (a.charAt(0) == '<') ? a : '<strong class="highlight">' + c + '</strong>';
}));
}
});
Я хочу выделить буквы с акцентом, например:
$('body').highlight("cao");
должен выделить: [ção] ИЛИ [çÃo] ИЛИ [cáo] ИЛИ expre[cão] ion ИЛИ [Cáo] ion
Как я могу это сделать?