Called by IRFactory to add a RegExp to the regexp table.
352485
public void addRegExp(RegExpLiteral re) {
        if (re == null) codeBug();
        if (regexps == null)
            regexps = new ArrayList<RegExpLiteral>();
        regexps.add(re);
        re.putIntProp(REGEXP_PROP, regexps.size() - 1);
    }
1242413
def compile_regex(self, fmt, query):
        """"""
        return re.compile(fmt.format(
            query.pattern.replace('.', '\.').replace('*', '[^\.]*').replace(
                '{', '(').replace(',', '|').replace('}', ')')
        ))
410067
function checkRegExp(test) {
  if (typeof test === 'string' && test[0] === '/') {
    var matchs = test.match(/^\/(.+)\/([igm]*)$/);
    if (matchs) {
      test = new RegExp(matchs[1], matchs[2]);
    }
  }
  return test;
}
1188596
def regxy(pattern, response, supress_regex, custom):
    """"""
    try:
        matches = re.findall(r'%s' % pattern, response)
        for match in matches:
            verb('Custom regex', match)
            custom.add(match)
    except:
        supress_regex = True
1158610
public EntityScannerBuilder<E> addRegexMatchFilter(String fieldName,
      String regexString) {
    RegexEntityFilter regexEntityFilter = new RegexEntityFilter(
        entityMapper.getEntitySchema(), entityMapper.getEntitySerDe(),
        fieldName, regexString);
    filterList.add(regexEntityFilter.getFilter());
    return this;
  }
779285
def raises_regex(self, expected_exception, expected_regexp):
        
        return unittest_case.assertRaisesRegexp(expected_exception, expected_regexp, self._orig_subject,
                                                *self._args, **self._kwargs)
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)
382605
def validate_regexp(ctx, param, value):
    
    if value:
        try:
            value = re.compile(value)
        except ValueError:
            raise click.BadParameter('invalid regular expression.')
    return value
5538
function tryCreateRegexp(src, flags, throwErrorAt, parser) {
  try {
    return new RegExp(src, flags);
  } catch (e) {
    if (throwErrorAt !== undefined) {
      if (e instanceof SyntaxError) parser.raise(throwErrorAt, "Error parsing regular expression: " + e.message);
      throw e;
    }
  }
}
306376
function buildRegex(pattern) {
    var re = pattern
      .replace(escapeRegex, '\\$&')
      .replace(namedParam, '([^/]*)')
      .replace(splatParam, '(.*?)');

    return new RegExp('^' + re + '$');
  }
504047
function createRegExp (regexp, options) {
    return new DuckType({
      name: options && options.name || null,
      test: function (object) {
        return ((object instanceof String) || typeof(object) === 'string') && regexp.test(object);
      }
    });
  }
1073627
def _setup_regex(self):
        """"""
        self.RE_COMMENTS = cache.RE_COMMENTS
        self.RE_MODULE = cache.RE_MODULE
        self.RE_TYPE = cache.RE_TYPE
        self.RE_EXEC = cache.RE_EXEC
        self.RE_MEMBERS = cache.RE_MEMBERS
        self.RE_DEPEND = cache.RE_DEPEND
1263525
def allowPatternsForNameChecking(self, patternsFunc, patternsClass):
        
        cfgParser = self.linter.cfgfile_parser
        nameChecker = self.getCheckerByName(NameChecker)
        if not nameChecker:
            return
        if patternsFunc:
            regexFuncAdd = "|((%s).+)$" % "|".join(patternsFunc)
        else:
            regexFuncAdd = ""
        if patternsClass:
            regexClassAdd = "|((%s).+)$" % "|".join(patternsClass)
        else:
            regexClassAdd = ""
        # Modify regex for function, method and class name.
        regexMethod = cfgParser.get("BASIC", "method-rgx") + regexFuncAdd
        regexFunction = cfgParser.get("BASIC", "function-rgx") + regexFuncAdd
        regexClass = cfgParser.get("BASIC", "class-rgx") + regexClassAdd
        # Save to config parser.
        cfgParser.set("BASIC", "method-rgx", regexMethod)
        cfgParser.set("BASIC", "function-rgx", regexFunction)
        cfgParser.set("BASIC", "class-rgx", regexClass)
        # Save to name checker.
        nameChecker.config.method_rgx = re.compile(regexMethod)
        nameChecker.config.function_rgx = re.compile(regexFunction)
        nameChecker.config.class_rgx = re.compile(regexClass)
1114907
def add_expr(src, code, indicator)
      case indicator
      when '='
        @escape ? add_expr_literal(src, code) : add_expr_escaped(src, code)
      when '=='
        @escape ? add_expr_escaped(src, code) : add_expr_literal(src, code)
      when '==='
        add_expr_debug(src, code)
      end
    end
1112479
def regexp_prompt(prompt, regexp='.', answer=''):
    '''
    
    '''
    get_input = getattr(__builtins__, 'raw_input', input)
    while not re.search(regexp, answer):
        answer = get_input(prompt + ': ').strip()
        # If the option isn't valid, this is shown next
        message = "Your entry must match the regular expression %s" %regexp    

    return answer
636788
def match(self, regexp, flags=None):
        """"""

        try:
            reg = _regexp_cache[(regexp, flags)]
        except KeyError:
            if flags:
                reg = re.compile(regexp, flags)
            else:
                reg = re.compile(regexp)
            _regexp_cache[(regexp, flags)] = reg

        return self.match_reg(reg)
1100469
def _short_ts_regexp():
	''''''
	ts_re = ['^']
	for k in it.chain(_short_ts_days, _short_ts_s):
		ts_re.append(r'(?P<{0}>\d+{0}\s*)?'.format(k))
	return re.compile(''.join(ts_re), re.I | re.U)