re.fullmatch is not available on Python<3.4.
355396
def _fullmatch(pattern, text, *args, **kwargs):
    """"""
    match = re.match(pattern, text, *args, **kwargs)
    return match if match.group(0) == text else None
1027949
def can_regex(self, field):
        ''''''
        from django.conf import settings
        if settings.DATABASES['default']['ENGINE'].endswith('sqlite3'):
            return not isinstance(get_real_field(self.model, field), UNSUPPORTED_REGEX_FIELDS)
        else:
            return True
1104213
def _match_excluded(self, filename, patterns):
        """"""

        return _wcparse._match_real(
            filename, patterns._include, patterns._exclude, patterns._follow, self.symlinks
        )
589560
def pattern_error(self, original, loc, value_var, check_var):
        """"""
        base_line = clean(self.reformat(getline(loc, original)))
        line_wrap = self.wrap_str_of(base_line)
        repr_wrap = self.wrap_str_of(ascii(base_line))
        return (
            "if not " + check_var + ":\n" + openindent
            + match_err_var + ' = _coconut_MatchError("pattern-matching failed for " '
            + repr_wrap + ' " in " + _coconut.repr(_coconut.repr(' + value_var + ")))\n"
            + match_err_var + ".pattern = " + line_wrap + "\n"
            + match_err_var + ".value = " + value_var
            + "\nraise " + match_err_var + "\n" + closeindent
        )
867445
function(str) {
  var abbrRegex = /^\-(\w+?)$/,
      fullRegex = /^\-\-(no\-)?(.+?)(?:=(.+))?$/,
      valRegex = /^[^\-].*/;

  var charMatch = abbrRegex.exec(str),
      chars = charMatch && charMatch[1].split("");

  var fullMatch = fullRegex.exec(str),
      full = fullMatch && fullMatch[2];

  var isValue = str !== undefined && (str === "" || valRegex.test(str));
  var value;
  if (isValue) {
    value = str;
  }
  else if (full) {
    value = fullMatch[1] ? false : fullMatch[3];
  }

  return {
    str: str,
    chars: chars,
    full: full,
    value: value,
    isValue: isValue
  }
}
1016509
def _compile(self, p):
        
        if self._is_value_filter(p) and p[0] == '=~':
            try:
                p[2] = re.compile(p[2])
            except:  # Python doesn't document exactly what exceptions re.compile throws
                raise ValueError('Bad regex - {0}'.format(p[2]))
        elif self._is_operator(p):
            for operator_or_filter in (p[1] if p[0] != '!' else [p[1]]):
                self._compile(operator_or_filter)
737511
def match_version_pattern(filename, pattern):
  

  if "{VERSION}" not in pattern:
    raise ValueError("pattern does not contain a {VERSION} reference")
  pattern = pattern.replace('{VERSION}', '(?P<v>[\d\w\.\-_]+)')
  expr = re.compile(pattern)
  with open(filename) as fp:
    lines = fp.read().split('\n')
  for i, line in enumerate(lines):
    match = expr.search(line)
    if match:
      return Match(filename, lines, line_index=i,
          version=Version(match.group('v')), span=match.span('v'))
  return None
732493
def python_version_matchers():
    """"""
    version = sys.version_info
    patterns = [
        "{0}",
        "{0}{1}",
        "{0}.{1}",
    ]
    matchers = [
        pattern.format(*version)
        for pattern in patterns
    ] + [None]
    return set(matchers)
972265
def _real_re_compile(self, *args, **kwargs):
        """"""
        try:
            return re.compile(*args, **kwargs)
        except re.error as e:
            # raise ValueError instead of re.error as this gives a
            # cleaner message to the user.
            raise ValueError('"' + args[0] + '" ' + str(e))
890518
public void mTokens() throws RecognitionException {
        // src/riemann/Query.g:1:8: ( AND | OR | NOT | APPROXIMATELY | REGEX_MATCH | NOT_EQUAL | EQUAL | LESSER | LESSER_EQUAL | GREATER | GREATER_EQUAL | TAGGED | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | ID | INT | FLOAT | WS | String )
        int alt13=31;
        alt13 = dfa13.predict(input);
        switch (alt13) {
            case 1 :
                // src/riemann/Query.g:1:10: AND
                {
                mAND(); 

                }
                break;
            case 2 :
                // src/riemann/Query.g:1:14: OR
                {
                mOR(); 

                }
                break;
            case 3 :
                // src/riemann/Query.g:1:17: NOT
                {
                mNOT(); 

                }
                break;
            case 4 :
                // src/riemann/Query.g:1:21: APPROXIMATELY
                {
                mAPPROXIMATELY(); 

                }
                break;
            case 5 :
                // src/riemann/Query.g:1:35: REGEX_MATCH
                {
                mREGEX_MATCH(); 

                }
                break;
            case 6 :
                // src/riemann/Query.g:1:47: NOT_EQUAL
                {
                mNOT_EQUAL(); 

                }
                break;
            case 7 :
                // src/riemann/Query.g:1:57: EQUAL
                {
                mEQUAL(); 

                }
                break;
            case 8 :
                // src/riemann/Query.g:1:63: LESSER
                {
                mLESSER(); 

                }
                break;
            case 9 :
                // src/riemann/Query.g:1:70: LESSER_EQUAL
                {
                mLESSER_EQUAL(); 

                }
                break;
            case 10 :
                // src/riemann/Query.g:1:83: GREATER
                {
                mGREATER(); 

                }
                break;
            case 11 :
                // src/riemann/Query.g:1:91: GREATER_EQUAL
                {
                mGREATER_EQUAL(); 

                }
                break;
            case 12 :
                // src/riemann/Query.g:1:105: TAGGED
                {
                mTAGGED(); 

                }
                break;
            case 13 :
                // src/riemann/Query.g:1:112: T__25
                {
                mT__25(); 

                }
                break;
            case 14 :
                // src/riemann/Query.g:1:118: T__26
                {
                mT__26(); 

                }
                break;
            case 15 :
                // src/riemann/Query.g:1:124: T__27
                {
                mT__27(); 

                }
                break;
            case 16 :
                // src/riemann/Query.g:1:130: T__28
                {
                mT__28(); 

                }
                break;
            case 17 :
                // src/riemann/Query.g:1:136: T__29
                {
                mT__29(); 

                }
                break;
            case 18 :
                // src/riemann/Query.g:1:142: T__30
                {
                mT__30(); 

                }
                break;
            case 19 :
                // src/riemann/Query.g:1:148: T__31
                {
                mT__31(); 

                }
                break;
            case 20 :
                // src/riemann/Query.g:1:154: T__32
                {
                mT__32(); 

                }
                break;
            case 21 :
                // src/riemann/Query.g:1:160: T__33
                {
                mT__33(); 

                }
                break;
            case 22 :
                // src/riemann/Query.g:1:166: T__34
                {
                mT__34(); 

                }
                break;
            case 23 :
                // src/riemann/Query.g:1:172: T__35
                {
                mT__35(); 

                }
                break;
            case 24 :
                // src/riemann/Query.g:1:178: T__36
                {
                mT__36(); 

                }
                break;
            case 25 :
                // src/riemann/Query.g:1:184: T__37
                {
                mT__37(); 

                }
                break;
            case 26 :
                // src/riemann/Query.g:1:190: T__38
                {
                mT__38(); 

                }
                break;
            case 27 :
                // src/riemann/Query.g:1:196: ID
                {
                mID(); 

                }
                break;
            case 28 :
                // src/riemann/Query.g:1:199: INT
                {
                mINT(); 

                }
                break;
            case 29 :
                // src/riemann/Query.g:1:203: FLOAT
                {
                mFLOAT(); 

                }
                break;
            case 30 :
                // src/riemann/Query.g:1:209: WS
                {
                mWS(); 

                }
                break;
            case 31 :
                // src/riemann/Query.g:1:212: String
                {
                mString(); 

                }
                break;

        }

    }
783562
def fullmatch(pattern, string, flags=0):
    """"""
    # Build a version of the pattern with a non-capturing group around it.
    # This is needed to get m.end() to correctly report the size of the
    # matched expression (as per the final doctest above).
    grouped_pattern = re.compile("^(?:%s)$" % pattern.pattern, pattern.flags)
    m = grouped_pattern.match(string)
    if m and m.end() < len(string):
        # Incomplete match (which should never happen because of the $ at the
        # end of the regexp), treat as failure.
        m = None  # pragma no cover
    return m
127286
function match(re, str) {
    var matches = [];
    if (Type.isString(str)) {
        str.replace(re, function () {
            matches.push([].slice.call(arguments).filter(function (item) {
                return item !== undefined;
            }));
        });
    } else {
        throw new Error('Core.match: String is not valid type');
    }
    return matches;
}
1253225
def pattern_match(data, values, level=None, regexp=False, has_nan=True):
    
    matches = np.array([False] * len(data))
    if not isinstance(values, collections.Iterable) or isstr(values):
        values = [values]

    # issue (#40) with string-to-nan comparison, replace nan by empty string
    _data = data.copy()
    if has_nan:
        _data.loc[[np.isnan(i) if not isstr(i) else False for i in _data]] = ''

    for s in values:
        if isstr(s):
            pattern = re.compile(_escape_regexp(s) + '$' if not regexp else s)
            subset = filter(pattern.match, _data)
            depth = True if level is None else find_depth(_data, s, level)
            matches |= (_data.isin(subset) & depth)
        else:
            matches |= data == s
    return matches
44545
function (str) {
            return _(str).chain()
                .unescapeHTML()
                .stripTags()
                .clean()
                .value()
                .replace( matchJunk, '' )
                .toLowerCase();
        }
1191714
def regex(self, *pattern, **kwargs):
        
        set_defaults(self._kwargs, kwargs)
        set_defaults(self._regex_defaults, kwargs)
        set_defaults(self._defaults, kwargs)
        pattern = self.rebulk.build_re(*pattern, **kwargs)
        part = ChainPart(self, pattern)
        self.parts.append(part)
        return part
176635
def isstrallowed(s,form):
    
    import re
    match = re.match(form,s)
    return match is not None
403694
def findViewWithAttributeThatMatches(self, attr, regex, root="ROOT"):
        '''
        
        '''

        return self.__findViewWithAttributeInTreeThatMatches(attr, regex, root)