I'm using the following JQuery to filter rows on a datatable, which works fine...

```
yuiDtFilter = function(tableDivId, filter) {
     //custom jQuery function defines case-insensitive fn:Contains, use default fn:contains for case-sensitive search
     jQuery.expr[':'].Contains = function(a,i,m){
       return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0;
     };
     $("#" + tableDivId + " .yui-dt-data").find('tr').hide();
     $("#" + tableDivId + " .yui-dt-data").find('td:Contains("' + filter + '")').parents('tr').show();
 }

```

However I have a need for the filter work in the opposite way. I need it to remove rows that *don't* match the search terms.

I've found out that I need to use 'not()', but I've spent most of the day in vain trying to get it to work (using every example I can find).

I've tried many variations of -

```
$("#" + tableDivId + " .yui-dt-data")
    .find(:not(('td:Contains("' + filter + '")'))
    .parents('tr').remove();

```

Could anyone give me a hand using my code as a starting point?