Matching on list elements

Matching on list elements

I am currently using the following line of jQuery to filter a table.
  1. $("td.tag").not(":contains('" + $("#filter_grade").val().toLowerCase() + "')").parent().hide();

Where #filter_grade is a text input box.
  1. <input type="text" name="filter_grade" id="filter_grade" class="filter">

The .tag class is on a hidden column like the following.
  1. <td class="tag" style="display:none;">272,13-292,</td>

Is there an easy way to modify the jQuery so it only matches complete strings in the list and not partials, so the above tag would be matched by 272 or 13-292 but not by 292 or 27 for example?

If you need more of the code the page in question can be viewed here...