I have this case insensitive custom selector :
jQuery.expr[':'].Contains = function(a,i,m) {
var text = jQuery(a).text().toUpperCase();
var words = m[3].split(/\s+/);
for(var i = 0; i < words.length; i++) {
if (-1 == text.indexOf(words[i].toUpperCase())) {
return false;
}
}
return true;
};
It works fine, but it gets messed up with accents. My question is thus simple, how could I make this selector both case and accent insensitive?
I was thinking of using a character map with regex, but I can't seem to make it run properly.
Thanks for your help.