I'm trying to create a Regex with jQuery so it will search for two words in an attribute of an XML file.
Can someone tell me how to return a result that contains BOTH words (sport and favorite) in any order and any case (upper or lower case)?
var regex = new RegExp("sport favorite", 'i');
var $result = $(data).filter(function() {
if($(this).attr('Description')) {
return $(this).attr('Description').match(regex);
}
});