Searches for all matches that comply with the instance's 'match' option
489167
function() {

      var match
      var matchIndex = 0
      var offset = 0
      var regex = this.options.find
      var textAggregation = this.getAggregateText()
      var matches = []
      var self = this
      regex = typeof regex === 'string' ? RegExp(escapeRegExp(regex), 'g') : regex
      matchAggregation(textAggregation)
      function matchAggregation(textAggregation) {
        for (var i = 0, l = textAggregation.length; i < l; ++i) {

          var text = textAggregation[i]
          if (typeof text !== 'string') {
            // Deal with nested contexts: (recursive)
            matchAggregation(text)
            continue
          }

          if (regex.global) {
            while (match = regex.exec(text)) {
              matches.push(self.prepMatch(match, matchIndex++, offset))
            }
          } else {
            if (match = text.match(regex)) {
              matches.push(self.prepMatch(match, 0, offset))
            }
          }

          offset += text.length
        }
      }

      return matches
    }
1062376
def recentMatches(self, **criteria):
        """"""
        if not self.matches: return [] # no match history
        try: # maxMatches is a specially handled parameter (not true criteria)
            maxMatches = criteria["maxMatches"]
            del criteria["maxMatches"]
        except AttributeError:
            maxMatches = c.RECENT_MATCHES
        alLMatches = self.matchSubset(**criteria)
        matchTimes = [(m.endTime, m) for m in matches]
        selMatches = sorted(matchTimes)[:maxMatches] # slice off X most recet matches
        retMatches = [m for endTime,m in selMatches] # extract matches only
        return retMatches
1290636
def match_files(self, matched, unmatched):
        """"""
        this_match = set(self.file_filter(unmatched))
        matched |= this_match
        unmatched -= this_match
865193
def get_all_supported_exts_for_type(self, type_to_match: Type[Any], strict: bool) -> Set[str]:
        
        matching = self.find_all_matching_parsers(desired_type=type_to_match, strict=strict)[0]
        return {ext for exts in [p.supported_exts for p in (matching[0] + matching[1] + matching[2])]
                for ext in exts}
1159092
def match(self, name, rdclass, rdtype, covers, deleting=None):
        """"""

        if not super(RRset, self).match(rdclass, rdtype, covers):
            return False
        if self.name != name or self.deleting != deleting:
            return False
        return True
342491
def args_match(m_args, m_kwargs, default, *args, **kwargs):
    
    if len(m_args) > len(args):
        return False
    for m_arg, arg in zip(m_args, args):
        matches = arg_match(m_arg, arg, eq)
        if not matches or matches is InvalidArg:
            return False  # bail out

    if m_kwargs:
        for name, m_arg in m_kwargs.items():
            name, comparator = arg_comparitor(name)
            arg = kwargs.get(name)
            if not arg_match(m_arg, arg, comparator, default):
                return False  # bail out
    return True
160321
def at_match(self, match, predicate=None, index=None):
        
        return self.at_span(match.span, predicate, index)
275718
def ismatch(self, s):
        
        if self._ismatchfun(s) and self._compiled_pattern.match(s):
            return True
        return False
149895
def matches_requirement?(query, option, requirement)
        !query.include?(option) || requirement.matches?(query[option], query)
      end
986189
def match(self, *args, **kwargs):
        
        return self._any_args or \
            self._arguments_rule.validate(*args, **kwargs)
549626
function findByNameEx(args, matches) {

		// create a variable to store the matches
		matches = matches || [];
		
		// set option defaults
		args.name       = Array.isArray(args.name) ? args.name : [args.name];
		args.recursive  = (typeof(args.recursive) === 'boolean') ? args.recursive : false;
		args.limit      = !isNaN(args.limit) ? args.limit : 1;
		args.properties = args.properties || [];
		
		// check for a starting point, if one doesnt exist begin at the datacenter level
		if (!args.parent) {
			return rootSearch(args)
			.then(function(parents) {
				return findByNameEx({
					type       : args.type,
					name       : args.name,
					properties : args.properties,
					parent     : parents,
					recursive  : args.recursive,
					limit      : args.limit
				}, matches);
			});
		}
		
		// convert the parent to an array if it is not one
		args.parent = Array.isArray(args.parent) ? args.parent : [args.parent];
		
		// perform the search
		return Promise.each(args.parent, function(parent) {
			
			// check if the match limit is met
			if (matches.length >= args.limit) {
				return;
			}
			
			// perform the search on each name
			return Promise.each(args.name, function(name) {
				
				// check if the match limit is met
				if (matches.length >= args.limit) {
					return;
				}
				
				// perform the search
				return _client.getServiceContent({
					method: 'FindChild',
					service: 'searchIndex',
					params: {
						entity: util.moRef(parent.type, parent.id),
						name: name
					}
				})
				.then(function(result) {

					var id = _.get(result, '$value');
					
					if (id) {
						matches.push(id);
					}					
				});
			})
			.then(function() {
				
				// check if the match limit is met, if not and recursive
				// attempt to descend the child objects
				if (matches.length < args.limit && args.recursive) {
					
					// get the children of the current parent
					return _client.retrieve({
						type: parent.type,
						id: parent.id,
						properties: ['childEntity']
					})
					.then(function(mo) {

						var parents = [];
						
						// get all of the child folders
						_.forEach(_.get(mo, '[0].childEntity'), function(child) {
							if (child.match(/^group-.*/)) {
								parents.push({
									type: 'Folder',
									id: child
								});
							}
						});
						
						// if there were folders, recurse
						if (parents.length > 0) {
							return findByNameEx({
								type       : args.type,
								name       : args.name,
								properties : args.properties,
								parent     : parents,
								recursive  : args.recursive,
								limit      : args.limit
							}, matches);
						}
					});
				}
			});
		})
		.then(function() {
			return matches;
		});
	}
1245579
private boolean findMatches() throws IOException {
    // check for something in queue of matches
    if (!queueMatches.isEmpty()) {
      return true;
    } else {
      ignoreItem.advanceToDoc(spans.docID());
      while (true) {
        // try to get something in queue of spans
        if (queueSpans.isEmpty() && !collectSpan()) {
          return false;
        }
        // try to get matches with first span in queue
        Match firstMatch = queueSpans.remove(0);
        // create a list of matches with same startPosition as firstMatch
        List<Match> matches = new ArrayList<>();
        matches.add(firstMatch);
        // matches.addAll(expandWithIgnoreItem(spans.docID(), firstMatch));
        // try to collect spans until lastStartPosition not equal to
        // startPosition of firstMatch
        while (!lastSpan && (lastStartPosition == firstMatch.startPosition())) {
          collectSpan();
        }
        while (!queueSpans.isEmpty() && (queueSpans.get(0)
            .startPosition() == firstMatch.startPosition())) {
          Match additionalMatch = queueSpans.remove(0);
          matches.add(additionalMatch);
          matches.addAll(expandWithIgnoreItem(spans.docID(), additionalMatch));
        }
        // construct all matches for this startPosition
        for (Match match : matches) {
          for (int n = (minimumRecurrence - 1); n <= (maximumRecurrence
              - 1); n++) {
            findMatches(match, n);
          }
        }
        // check for something in queue of matches
        if (!queueMatches.isEmpty()) {
          ignoreItem.removeBefore(spans.docID(),
              queueMatches.get(0).startPosition());
          return true;
        }
      }
    }
  }
1073895
def find_matches(self, text):
        """"""
        if self.use_main_ns:
            self.namespace = __main__.__dict__

        if "." in text:
            return self.attr_matches(text)
        else:
            return self.global_matches(text)
132313
def ismatch(text, pattern):
    """"""

    if hasattr(pattern, 'search'):
        return pattern.search(text) is not None
    else:
        return pattern in text if Config.options.case_sensitive \
            else pattern.lower() in text.lower()
1022520
def match?(time, base)
      aligned?(time, base) && @filters.all? { |f| f.match?(time) }
    end
811955
protected EofMatch findEof(Match matches[]) {
        EofMatch ourEof = null;
        for (int i = 0; i < matches.length; i++) {
            if (matches[i] instanceof EofMatch)
                ourEof = (EofMatch) matches[i];
        }

        if (ourEof == null) {
            // Have to create our own
            ourEof = new EofMatch();
        }

        return ourEof;
    }
185176
def _find_match(ele, lst):
    '''
    
    '''
    for _ele in lst:
        for match_key in _MATCH_KEYS:
            if _ele.get(match_key) == ele.get(match_key):
                return ele