Need help with jquery.validator.addMethod

Need help with jquery.validator.addMethod

I am trying to add a rule that will filter out profanity for a textarea on a form.  I pieced together the code below and it works for the first word in the filter array, but doesn't for the rest.  Any help would be appreciated.

  1.  $(document).ready(function(){
  2.      //custom validation rule - profanity
  3.  $.validator.addMethod("profanity",  function(value, element)
  4.   {
  5. var filter = ['bad', 'word'];
  6. var i=0;
  7. for (i=0;i<=filter.length;i++)
  8.     {
  9.      return !RegExp('\\b' + filter[i] + '\\b', 'gi').test(value);
  10.     }
  11.   }
  12.  );