Check if the regular expression generates the value
773479
def regexpExec(self, content):
        
        ret = libxml2mod.xmlRegexpExec(self._o, content)
        return ret
574656
function () {
            var match = this._parser.exec(this._content);
            if (!match) {
                return false;    // Stop parsing
            }
            this._addValue(match);
            return this._checkAfterValue(match);
        }
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;
    }
163899
def matches(property_name, regex, *, present_optional=False, message=None):
    """"""
    def check(val):
      """Checks that a value matches a scope-enclosed regex."""
      if not val:
        return present_optional
      else:
        return True if regex.search(val) else False

    return Validation(check, property_name, message)
638332
function check(node) {
		if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0])) {
			var flags = isString(node.arguments[1]) ? node.arguments[1].value : "";

			if (allowedFlags) {
				flags = flags.replace(new RegExp("[" + allowedFlags + "]", "gi"), "");
			}

			try {
				void new RegExp(node.arguments[0].value);
			} catch (e) {
				context.report(node, e.message);
			}
			if (flags) {
				try {
					var result = parser.parse("/./" + flags, context.parserOptions);
					if (result.body.length > 0) {
						var expressionStatement = result.body[0];
						var regexp = expressionStatement.expression;
						if (regexp && regexp.value === null) {
							context.report(node, ProblemMessages.noInvalidRegexp, {
								arg: flags
							});
						}
					}
				} catch (ex) {
					context.report(node, ProblemMessages.noInvalidRegexp, {
						arg: flags
					});
				}
			}
		}
	}
350046
def match_regexp(self, value, q, strict=False):
        """"""
        value = stringify(value)
        mr = re.compile(q)
        if value is not None:
            if mr.match(value):
                return
        self.shout('%r not matching the regexp %r', strict, value, q)
1311444
static boolean containsMatch(String actual, String regex) {
    return Pattern.compile(regex).matcher(actual).find();
  }
383156
function(){
        var r =  new RegExp("\(([^\)]+)\)");
        var found, i;
        return ((found = this.toString().match(r)[0]),(i = found.indexOf('(')+1),(found).substring(i)).replace(/ /,'').split(/,/);
    }
1269869
function typedValue(value) {
  if (value[0] == '!') value = value.substr(1)
  var regex = value.match(/^\/(.*)\/(i?)$/);
  var quotedString = value.match(/(["'])(?:\\\1|.)*?\1/);

  if (regex) {
    return new RegExp(regex[1], regex[2]);
  } else if (quotedString) {
    return quotedString[0].substr(1, quotedString[0].length - 2);
  } else if (value === 'true') {
    return true;
  } else if (value === 'false') {
    return false;
  } else if (iso8601.test(value) && value.length !== 4) {
    return new Date(value);
  } else if (!isNaN(Number(value))) {
    return Number(value);
  }

  return value;
}
1013735
def check(self, regex):
        
        return self.scan_full(regex, return_string=True, advance_pointer=False)
878166
private static boolean check(String data, Pattern pattern) {
        if (StringUtils.isEmpty(data)) {
            return false;
        }
        Matcher matcher = pattern.matcher(data);
        return matcher.matches();
    }
494836
def validate(self, input_string):
        
        validation_result = False
        try:
            validation_result = bool(match(pattern=self.pattern, string=input_string))
        except TypeError as e:
            self.log.error(
                'Exception while validating Regex, pattern={}, input_string={} - exception: {}'.format(self.pattern,
                                                                                                       input_string,
                                                                                                       e))
        return validation_result
612492
boolean matches(String value) {
    if (pattern == null) {
      return true;
    }
    return pattern.matcher(value).matches();
  }
524622
def validate(self):
        
        from pyrocore.torrent import formatting

        super(PatternFilter, self).validate()
        self._value = self._value.lower()
        self._template = None
        self._is_regex = self._value.startswith('/') and self._value.endswith('/')
        if self._is_regex:
            self._matcher = re.compile(self._value[1:-1]).search
        elif self._value.startswith('{{') or self._value.endswith('}}'):
            def _template_globber(val, item):
                """Helper."""
                pattern = formatting.format_item(self._template, item).replace('[', '[[]')
                ##print('!!!', val, '~~~', pattern, '???')
                return fnmatch.fnmatchcase(val, pattern.lower())

            self._template = formatting.preparse(self._value)
            self._matcher = _template_globber
        else:
            self._matcher = lambda val, _: fnmatch.fnmatchcase(val, self._value)
1181138
public boolean isValid(String value) {
    if (value == null) {
      return false;
    }
    for (int i = 0; i < patterns.length; i++) {
      if (patterns[i].matcher(value).matches()) {
        return true;
      }
    }
    return false;
  }
953330
def is_valid_regex(regex):
    """"""
    if len(regex) == 0:
        return False
    try:
        re.compile(regex)
        return True
    except sre_constants.error:
        return False
742465
function assertStd (result, std) {
    var message = 'Expected value to match following regexp: ' + std + ', but got: ' + result;

    if (typeof std === 'string' || typeof std === 'number') {
      assert.equal(result && result.code || result, std);
    }
    else if (std instanceof RegExp) {
      assert.isNotNull(result.match(std), message);
    }
    else if (typeof std === 'function') {
      assert.ok(std(result));
    }
    else if (typeof result !== 'string' && result !== null) {
      assert.equal(result.code, 0);
    }
  }