code: function getFilterFunc(selector, context) {
      function wordRegExpTester(name, prop) {
        var re = RegExp('(^|\\s+)' + name + '(?=$|\\s)', 'i');
        return function(obj) {return  name ? re.test(obj[prop]) : true;};
      }
  
      var nodeSet = {};
      var dotPos = nodeSet;
      if (isFunction(selector))
        return selector;
      else if (isNumber(selector))
        return function(v, index) { return index == selector; };
      else if (!selector || selector == '*' ||
               (isString(selector) && (dotPos = /^([\w-]*)\.?([\w-]*)$/.exec(selector)))) {
        var nodeNameFilter = wordRegExpTester(dotPos[1], 'tagName');
        var classNameFilter = wordRegExpTester(dotPos[2], 'className');
        return function(v) {
          return isNode(v) == 1 && nodeNameFilter(v) && classNameFilter(v);
        };
      }
      else if (context)
        return function(v) {
          return $(selector, context)['find'](v)!=_null; // live search instead of node set, for on()
        };
      else {
        $(selector)['each'](function(node) {
          nodeSet[getNodeId(node)] = true;
        });
        return function(v) {
          return nodeSet[getNodeId(v)];
        };
      }
    }
docs: If context is set, live updates will be possible. Please note that the context is not evaluated for the '*' and 'tagname.classname' patterns, because context is used only by on(), and in on() only nodes in the right context will be checked