filter CDX by regex if each filter is :samp:`{field}:{regex}` form,
    apply filter to :samp:`cdx[{field}]`.
432126
def cdx_filter(cdx_iter, filter_strings):
    
    # Support single strings as well
    if isinstance(filter_strings, str):
        filter_strings = [filter_strings]

    filters = [CDXFilter(filter_str) for filter_str in filter_strings]

    for cdx in cdx_iter:
        if all(x(cdx) for x in filters):
            yield cdx
1003209
def regex(val, schema, name = None): # pylint: disable-msg=W0613
    
    if name is None:
        name = schema

    if not _regexs.has_key(name):
        return False

    try:
        if _regexs[name](val):
            return True
    except TypeError:
        pass

    return False
543005
def _in(field, filter_value):
        
        valid = False
        if field in filter_value:
            valid = True
        return valid
273309
def setup_regex(self):
        """"""
        self._RX_INTERFACE = (r"\n\s*interface\s+(?P<name>[a-z0-9_]+)(\s\((?P<symbol>[.\w+*=/-]+)\))?"
                              r"(?P<contents>.+?)"
                              r"end\s*interface\s+(?P=name)?")
        self.RE_INTERFACE = re.compile(self._RX_INTERFACE, re.I | re.DOTALL)
742942
public function whereRegex($field, $regex, $flags = '')
    {
        $this->_filters[] = [$field => ['$regex' => $regex, '$options' => $flags]];

        return $this;
    }
423500
def regex(name, regexp, options = {})
      field name, RegexField.new(regexp, options)
    end
328412
function filter(file) {
    if (files.indexOf(file) !== -1) return false;
    let include = true;
    regexs.forEach((regex) => {
      if (file.search(regex) !== -1) include = false;
    });
    return include;
  }
945011
def filter_lines(lines, filter_regex, groups=None):
    
    pattern = re.compile(filter_regex)
    for line in lines:
        match = pattern.search(line)
        if match:
            if groups is None:
                yield line
            elif len(groups) == 1:
                yield match.group(groups[0])
            else:
                matched_groups = match.groupdict()
                yield tuple(matched_groups.get(group) for group in groups)
568599
def _create_regexp_filter(regex):
  
  # Warning: Note that python's regex library allows inputs that take
  # exponential time. Time-limiting it is difficult. When we move to
  # a true multi-tenant tensorboard server, the regexp implementation here
  # would need to be replaced by something more secure.
  compiled_regex = re.compile(regex)
  def filter_fn(value):
    if not isinstance(value, six.string_types):
      raise error.HParamsError(
          'Cannot use a regexp filter for a value of type %s. Value: %s' %
          (type(value), value))
    return re.search(compiled_regex, value) is not None

  return filter_fn
1045760
function filtered(js) {
  return js.substr(1).split('|').reduce(function(js, filter){
    var parts = filter.split(':')
      , name = parts.shift()
      , args = parts.shift() || '';
    if (args) args = ', ' + args;
    return 'filters.' + name + '(' + js + args + ')';
  });
}
265810
def result(self):
         
        field = re.sub(REGEX_CLEANER, '', self.field_name)

        if self.alias:
            alias = re.sub(REGEX_CLEANER, '', self.alias)
            return "%s AS %s" % (field, alias)
        else:
            return field
796753
function filter(callback) {
        var filteredMatches = [];

        each(function (match, i) {
          if (callback(match, i)) {
            filteredMatches.push(match);
          }
        });

        matches = filteredMatches;

        /*jshint validthis:true*/
        return this;
      }
435238
function filterFiles(files, check) {
	return files.filter(function(file) {
		if (typeof check == 'string') {
			// ignore typecase equal
			return check.toLowerCase() === file.toLowerCase();
		} else if (Util.isRegExp(check)) {
			// regexp test
			return check.test(file);
		} else if (typeof check == 'function') {
			// function callback
			return check(file);
		}
	});
}
1061273
def compile_infix_regex(entries):
    
    expression = "|".join([piece for piece in entries if piece.strip()])
    return re.compile(expression)
45979
def match_filter(self, idx_list, pattern, dict_type=False,
                     dict_key='name'):
        

        if dict_type is False:
            return self._return_deque([
                obj for obj in idx_list
                if re.search(pattern, obj)
            ])
        elif dict_type is True:
            return self._return_deque([
                obj for obj in idx_list
                if re.search(pattern, obj.get(dict_key))
            ])
        else:
            return self._return_deque()
960378
def setup_regex(self):
        """"""
        #Regex for extracting modules from the code
        self._RX_MODULE = r"(\n|^)\s*module\s+(?P<name>[a-z0-9_]+)(?P<contents>.+?)end\s*module"
        self.RE_MODULE = re.compile(self._RX_MODULE, re.I | re.DOTALL)
        self._RX_PROGRAM = r"(\n|^)\s*program\s+(?P<name>[a-z0-9_]+)(?P<contents>.+?)end\s*program"
        self.RE_PROGRAM = re.compile(self._RX_PROGRAM, re.I | re.DOTALL)

        #Regex for use statements in a module
        self._RX_USE = r"^\s*use\s+(?P<name>[^,]+?)(\s*,\s+only\s*:(?P<only>[A-Za-z0-9_\s,]+?))?$"
        self.RE_USE = re.compile(self._RX_USE, re.I | re.M)
        #Regex for finding if the module is private
        self._RX_PRIV = "private.+?(type|contains)"
        self.RE_PRIV = re.compile(self._RX_PRIV, re.DOTALL | re.I)
        #Regex for finding publcily labeled members declared using public keyword.
        self._RX_PUBLIC = r"\n\s*public\s+(?P<methods>[A-Za-z0-9_,\s&\n]+)"
        self.RE_PUBLIC = re.compile(self._RX_PUBLIC, re.I)
        #Regex for finding text before type or contains declarations that may contian members.
        self._RX_MEMBERS = "(?P<preamble>.+?)(\s+type[,\s]|contains)"
        self.RE_MEMBERS = re.compile(self._RX_MEMBERS, re.DOTALL | re.I)

        self._RX_PRECOMP = r"#endif"
        self.RE_PRECOMP = re.compile(self._RX_PRECOMP, re.I)
950759
function filter(fp, opts) {
  if (opts && opts.filter) {
    return opts.filter(fp, opts);
  }
  return /[^x]\.js$/.test(fp);
}