also called in PatternType
166064
static boolean hasUnixChronology(Chronology<?> chronology) {

        Chronology<?> c = chronology;

        do {
            if (UnixTime.class.isAssignableFrom(c.getChronoType())) {
                return true;
            }
        } while ((c = c.preparser()) != null);

        return false;

    }
912622
private boolean matchLemmaRegexp(AnalyzedTokenReadings aToken,
      Pattern pattern) {
    boolean matches = false;
    for (AnalyzedToken analyzedToken : aToken) {
      final String posTag = analyzedToken.getLemma();
      if (posTag != null) {
        final Matcher m = pattern.matcher(posTag);
        if (m.matches()) {
          matches = true;
          break;
        }
      }
    }
    return matches;
  }
245288
private void checkPatternMatching(Map<String, PatternCacheControl> patterns, String specificPattern, String generalPattern) {
        if (PatternMatcherUtils.caseInsensitiveMatch(specificPattern, generalPattern)) {
            PatternCacheControl specificPatternDirective = patterns.get(specificPattern);
            PatternCacheControl generalPatternDirective = patterns.get(generalPattern);
            generalPatternDirective.incrementMatchingPatternCount();
            ConflictResolverUtils.resolveConflicts(specificPatternDirective, generalPatternDirective);
        }
    }
1316751
private String matchPatternInBuffer(Pattern pattern) {
        matchValid = false;
        matcher.usePattern(pattern);
        matcher.region(position, buf.limit());
        if (matcher.lookingAt()) {
            if (matcher.hitEnd() && (!sourceClosed)) {
                // Get more input and try again
                needInput = true;
                return null;
            }
            position = matcher.end();
            return matcher.group();
        }

        if (sourceClosed)
            return null;

        // Read more to find pattern
        needInput = true;
        return null;
    }
78986
private void filterDef( PatternDescrBuilder< ? > pattern ) throws RecognitionException {
        BehaviorDescrBuilder< ? > behavior = helper.start( pattern,
                                                           BehaviorDescrBuilder.class,
                                                           null );
        try {
            String bName = label( DroolsEditorType.IDENTIFIER_PATTERN );
            if ( state.failed ) return;

            Token subtype = match( input,
                                   DRL5Lexer.ID,
                                   null,
                                   null,
                                   DroolsEditorType.IDENTIFIER_PATTERN );
            if ( state.failed ) return;

            if ( state.backtracking == 0 ) {
                behavior.type( bName,
                               subtype.getText() );
            }

            List<String> parameters = parameters();
            if ( state.failed ) return;

            if ( state.backtracking == 0 ) {
                behavior.parameters( parameters );
            }
        } finally {
            helper.end( BehaviorDescrBuilder.class,
                        behavior );
        }
    }
410523
function any(/* patterns... */) {
        var patterns = [].slice.call(arguments, 0);
        var name = '(' + patterns.join(' | ') + ')';

        return new Pattern(name, function (str, pos) {
            var r, i;
            for (i = 0; i < patterns.length && !r; i++)
                r = patterns[i].exec(str, pos);
            return r;
        });
    }
1327919
public static <S, T extends Event, U extends T> InputMapTemplate<S, U> ignore(
            EventPattern<? super T, ? extends U> eventPattern) {
        return new PatternActionTemplate<>(eventPattern, PatternActionTemplate.CONST_IGNORE);
    }
306678
protected List<PMultipleBind> getMultipleTypeBindList(PType patternType,
			ILexNameToken... patternNames)
	{
		List<PMultipleBind> typeBindList = new Vector<PMultipleBind>();
		typeBindList.add(getMultipleTypeBind(patternType, patternNames));
		return typeBindList;
	}
275322
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) {
            var elements = pattern.elements;
            if (elements.length === 0 || elements[elements.length - 1].dotDotDotToken) {
                return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType;
            }
            // If the pattern has at least one element, and no rest element, then it should imply a tuple type.
            var elementTypes = ts.map(elements, function (e) { return e.kind === 193 /* OmittedExpression */ ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors); });
            var result = createTupleType(elementTypes);
            if (includePatternInType) {
                result = cloneTypeReference(result);
                result.pattern = pattern;
            }
            return result;
        }
1168107
private static boolean matchesPatternList(final String str, final List<Pattern> patterns) {
        if (patterns != null) {
            for (final Pattern pattern : patterns) {
                if (pattern.matcher(str).matches()) {
                    return true;
                }
            }
        }
        return false;
    }
379105
def pattern(name, pattern):
  
  pattern.setName(name)
  astracing.maybe_trace(pattern)
  return pattern
1306799
def _fetch_type_main(cls, cls_in, match):
        

        return cls._str_to_type(
            cls_in,
            match.group(cls._SUBMATCH_INDEX_TYPE_MAIN)
        )
956073
function filter(patterns) {
  if (typeof patterns === 'function') {
    return patterns;
  }

  return function(str) {
    var arr = ['\\[\\!\\[', '{%', '<%'].concat(patterns || []);
    var re = new RegExp(arr.join('|'));
    return !re.test(str);
  };
}
1028727
function matchPatternOrExact(patternStrings, candidate) {
        var patterns = [];
        for (var _i = 0, patternStrings_1 = patternStrings; _i < patternStrings_1.length; _i++) {
            var patternString = patternStrings_1[_i];
            var pattern = tryParsePattern(patternString);
            if (pattern) {
                patterns.push(pattern);
            }
            else if (patternString === candidate) {
                // pattern was matched as is - no need to search further
                return patternString;
            }
        }
        return findBestPatternMatch(patterns, function (_) { return _; }, candidate);
    }
747613
def ILIKE(pattern):
    """"""
    return P(lambda x: fnmatch.fnmatch(x.lower(), pattern.lower()))
817782
function fitsInPatternTypes(path, pattern) {
            var i;

            if (pattern.items && pattern.items.length > 0) {
                for (i = 0; i < pattern.items.length; i += 1) {
                    if (self.isTypeOf(path, pattern.items[i])) {
                        return true;
                    }
                }
                return false;
            } else {
                return true;
            }
        }
561346
def either(self):
        """"""
        # Currently the pattern will not be equivalent, but more "narrow",
        # although good enough to reason about list arguments.
        if not hasattr(self, 'children'):
            return Either(Required(self))
        else:
            ret = []
            groups = [[self]]
            while groups:
                children = groups.pop(0)
                types = [type(c) for c in children]
                if Either in types:
                    either = [c for c in children if type(c) is Either][0]
                    children.pop(children.index(either))
                    for c in either.children:
                        groups.append([c] + children)
                elif Required in types:
                    required = [c for c in children if type(c) is Required][0]
                    children.pop(children.index(required))
                    groups.append(list(required.children) + children)
                elif Optional in types:
                    optional = [c for c in children if type(c) is Optional][0]
                    children.pop(children.index(optional))
                    groups.append(list(optional.children) + children)
                elif OneOrMore in types:
                    oneormore = [c for c in children if type(c) is OneOrMore][0]
                    children.pop(children.index(oneormore))
                    groups.append(list(oneormore.children) * 2 + children)
                else:
                    ret.append(children)
            return Either(*[Required(*e) for e in ret])