match :: Editor, [(Editor -> Matcher.result | Null)] -> Matcher.result | Null
549702
function (editor, matchers) {
      for (var i = 0; i < matchers.length; i++) {
        var f = matchers[i];
        var result = f(editor);

        if (result) {
          return result;
        }
      }

      return null;
    }
582419
public static <E> void removeMatcing(Collection<E> collection, Matcher<? super E> matcher) {
		Iterator<E> iter = collection.iterator();
		while (iter.hasNext()) {
			E item = iter.next();
			if (matcher.matches(item)) iter.remove();
		}
	}
543975
private static Object matchOrReplace(Context cx, Scriptable scope,
                                         Scriptable thisObj, Object[] args,
                                         RegExpImpl reImpl,
                                         GlobData data, NativeRegExp re)
    {
        String str = data.str;
        data.global = (re.getFlags() & NativeRegExp.JSREG_GLOB) != 0;
        int[] indexp = { 0 };
        Object result = null;
        if (data.mode == RA_SEARCH) {
            result = re.executeRegExp(cx, scope, reImpl,
                                      str, indexp, NativeRegExp.TEST);
            if (result != null && result.equals(Boolean.TRUE))
                result = Integer.valueOf(reImpl.leftContext.length);
            else
                result = Integer.valueOf(-1);
        } else if (data.global) {
            re.lastIndex = 0d;
            for (int count = 0; indexp[0] <= str.length(); count++) {
                result = re.executeRegExp(cx, scope, reImpl,
                                          str, indexp, NativeRegExp.TEST);
                if (result == null || !result.equals(Boolean.TRUE))
                    break;
                if (data.mode == RA_MATCH) {
                    match_glob(data, cx, scope, count, reImpl);
                } else {
                    if (data.mode != RA_REPLACE) Kit.codeBug();
                    SubString lastMatch = reImpl.lastMatch;
                    int leftIndex = data.leftIndex;
                    int leftlen = lastMatch.index - leftIndex;
                    data.leftIndex = lastMatch.index + lastMatch.length;
                    replace_glob(data, cx, scope, reImpl, leftIndex, leftlen);
                }
                if (reImpl.lastMatch.length == 0) {
                    if (indexp[0] == str.length())
                        break;
                    indexp[0]++;
                }
            }
        } else {
            result = re.executeRegExp(cx, scope, reImpl, str, indexp,
                                      ((data.mode == RA_REPLACE)
                                       ? NativeRegExp.TEST
                                       : NativeRegExp.MATCH));
        }

        return result;
    }
598979
function or(matches, pattern, file) {
  var length = matches.length
  var note = pattern.note
  var id = pattern.id
  var index = -1
  var match
  var next
  var siblings
  var sibling
  var value
  var nodes
  var start
  var end

  while (++index < length) {
    match = matches[index]
    siblings = match.parent.children
    nodes = match.nodes
    value = toString(nodes)
    next = matches[index + 1]

    if (next && next.parent === match.parent && next.type !== match.type) {
      start = match.end
      end = next.start

      while (++start < end) {
        sibling = siblings[start]

        if (
          sibling.type === ws ||
          (sibling.type === word && /(and|or)/.test(normalize(sibling))) ||
          (sibling.type === punc && normalize(sibling) === '/')
        ) {
          continue
        }

        break
      }

      /* If we didn't break... */
      if (start === end) {
        index++
        continue
      }
    }

    warn(
      file,
      id,
      value,
      pattern.considerate,
      nodes[0],
      note,
      pattern.condition
    )
  }
}
1165385
@Factory
    public static Matcher<Proc> raises(Class<? extends Throwable> clazz, String regex) {
        return raises(IsThrowable.throwable(clazz, regex));
    }
713081
function matchToHolders(match, tag) {
  return object(match.map(function(val, index) {
    return [tag+":"+index, val];
  }));
}
1082983
def perform_matched_selection(self, event):
        
        selected = TextHelper(self.editor).match_select()
        if selected and event:
            event.accept()
943817
def matches(match_method, *params)
      return [] unless match_method.respond_to?(:yield)
      matches = match_method.yield(*params)
      return [] unless matches.respond_to?(:each)

      # We convert Nokogiri nodes to matches transparently
      matches.map do |m|
        if m.respond_to?(:node_name)
          match(m)
        elsif m.respond_to?(:xpath)
          m.to_a.map { |n| match(n) }
        else
          m
        end
      end.flatten
    end
555076
public String replaceAllInWith(String regEx, String value, String replace) {
        String result = null;
        if (value != null) {
            if (replace == null) {
                // empty cell in table is sent as null
                replace = "";
            }
            result = getMatcher(regEx, value).replaceAll(replace);
        }
        return result;
    }
921700
function matchRegExp(oRule, context, options) {
    if (context[oRule.key] === undefined) {
        return undefined;
    }
    var sKey = oRule.key;
    var s1 = context[oRule.key].toLowerCase();
    var reg = oRule.regexp;
    var m = reg.exec(s1);
    if (debuglogV.enabled) {
        debuglogV("applying regexp: " + s1 + " " + JSON.stringify(m));
    }
    if (!m) {
        return undefined;
    }
    options = options || {};
    var delta = compareContext(context, oRule.follows, oRule.key);
    debuglogV(function () { return JSON.stringify(delta); });
    debuglogV(function () { return JSON.stringify(options); });
    if (options.matchothers && (delta.different > 0)) {
        return undefined;
    }
    var oExtractedContext = extractArgsMap(m, oRule.argsMap);
    debuglogV(function () { return "extracted args " + JSON.stringify(oRule.argsMap); });
    debuglogV(function () { return "match " + JSON.stringify(m); });
    debuglogV(function () { return "extracted args " + JSON.stringify(oExtractedContext); });
    var res = AnyObject.assign({}, oRule.follows);
    res = AnyObject.assign(res, oExtractedContext);
    res = AnyObject.assign(res, context);
    if (oExtractedContext[sKey] !== undefined) {
        res[sKey] = oExtractedContext[sKey];
    }
    if (options.override) {
        res = AnyObject.assign(res, oRule.follows);
        res = AnyObject.assign(res, oExtractedContext);
    }
    Object.freeze(res);
    debuglog(debuglog.enabled ? ('Found one' + JSON.stringify(res, undefined, 2)) : '-');
    return res;
}
67251
function match( o, p, strict ) {

        var o_type = get_type( o ),
            p_type = get_type( p );

        if ( strict ) {

            // In strict mode, objects must have the same type
            if ( o_type !== p_type ) { return false; }

            switch( o_type ) {

                case 'array':
                    return match_arrays( o, p, true );

                case 'boolean':
                    return o === p;

                case 'nan':
                case 'null':
                case 'undefined':
                    return true;

                case 'function':
                case 'number':
                case 'regexp':
                case 'string':
                    return o.toString() === p.toString();

                case 'object':
                    return match_objects( o, p, true );

            }

        } else {

            switch( p_type ) {

                case 'array':
                    return o_type === 'array'
                                ? match_arrays( o, p, false )
                                : false;

                case 'boolean':
                case 'number':
                case 'string':
                    return p == o;

                case 'function':
                    return !!p( o );

                case 'nan':
                    return isNaN( o );

                case 'null':
                case 'undefined':
                    return o_type === p_type;

                case 'object':
                    return o_type === 'object'
                                ? match_objects( o, p, false )
                                : false;

                case 'regexp':
                    return o_type === 'string' && p.test( o );

            }

        }

    }
550044
function(matches, index, tokens, regexValue) {
      var i = tokens.length;

      while (--i >= 0) {
        var token = tokens[i];
        var type = token.type;

        if (type === _Comment ||
            type === _WhiteSpace ||
            type === _LineTerminator) {
          continue;
        }

        var value = token.value;
        if (type === _Punctuator) {
          if (value === ')') {
            if (this.isValidRegExpPrefix(tokens, i + 1)) {
              break;
            }
          } else if (regexPrefixRe.test(value)) {
            break;
          }
        } else if ((type === _Keyword && regexPrefixRe.test(value)) ||
                   (type === _Template && value.slice(-2) === '${')) {
          break;
        }

        var parts = regexValue.match(tokenizeNotRegExpRe);
        splice.apply(matches, [index, 1].concat(parts));
        return true;
      }
      return false;
    }
855269
function match(input) {
    let lowerInput = input.toLowerCase();
    let simpleMatch = _simpleMatch(lowerInput);
    let complexMatch = _complexMatch(lowerInput);
    let output = simpleMatch.concat(complexMatch);

    return output;
}
1339156
function Matcher (patternFn, successFn, next) {
    this.patternFn = patternFn;
    this.successFn = successFn;
    this.next = next;
  }
118615
static Matcher removeSequentialMatchAny(Matcher matcher) {
    if (matcher instanceof ZeroOrMoreMatcher) {
      ZeroOrMoreMatcher zm1 = matcher.as();
      if (zm1.repeated() instanceof AnyMatcher && zm1.next() instanceof ZeroOrMoreMatcher) {
        ZeroOrMoreMatcher zm2 = zm1.next().as();
        if (zm2.repeated() instanceof AnyMatcher) {
          return zm2;
        }
      }
    }
    return matcher;
  }
134466
function( elem, context, xml ) {
			while ( (elem = elem[ dir ]) ) {
				if ( checkNonElements || elem.nodeType === 1  ) {
					return matcher( elem, context, xml );
				}
			}
		}
422762
function (scanner, matcher) {
  var start = scanner.pos;
  var result = matcher(scanner);
  scanner.pos = start;
  return result;
}