Check if provided value match provided RegExp
@param {string} value
@param {RegExp} regExp
@param {string} message
@param {string} id
@returns {void}
495569
function match(value, regExp, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && !regExp.test(value)) {
        throw LogicException.throw(assertionTypes.MATCH, value, message, id);
    }
}
970499
function match(regexp) {
        var O = requireObjectCoercible(this);
        var matcher = regexp == undefined ? undefined : regexp[MATCH];
        return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
      }
322051
public static boolean valueMatchesRegularExpression(String val, String regexp) {
		Pattern p = cache.get(regexp);
		if(p == null) {
			p = Pattern.compile(regexp);
			cache.put(regexp, p);
		}
		return valueMatchesRegularExpression(val, p);
	}
736436
private static void checkRegexp(String regexp) {
        String checking = regexp.replaceAll("\\\\\\(", "X").replaceAll("\\(\\?", "X");
        int checked = checking.indexOf('(');
        if (checked > -1) {
            StringBuilder msg = new StringBuilder("Only non-capturing groups allowed:\r\n" +
                    regexp + "\r\n");
            for (int i = 0; i < checked; i++) {
                msg.append(" ");
            }
            msg.append("^");
            throw new IllegalArgumentException(msg.toString());
        }
    }
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
					});
				}
			}
		}
	}
515698
def regexpr_validator(value):
    
    try:
        re.compile(value)
    except re.error:
        raise ValidationError(
            _('"%(value)s" is not a valid regular expression'),
            params={'value': value}
        )
742802
function parseRegExp( str ) {
	var re = regex( str );
	if ( re === null ) {
		return new TypeError( 'invalid value. Unable to parse string as a regular expression. Value: `' + str + '`.' );
	}
	return re;
}
504884
function Plugin(regexp, replacer, id) {
    // return value should be a callable function
    // with strictly defined options passed by markdown-it
    var self = function(md, options) {
        self.options = options;
        self.init(md);
    };

    // initialize plugin object
    self.__proto__ = Plugin.prototype;

    // clone regexp with all the flags
    var flags = (regexp.global ? 'g' : '') + (regexp.multiline ? 'm' : '') + (regexp.ignoreCase ? 'i' : '');

    self.regexp = RegExp('^' + regexp.source, flags);

    // copy init options
    self.replacer = replacer;

    // this plugin can be inserted multiple times,
    // so we're generating unique name for it
    self.id = id ? id : 'regexp-' + counter;
    counter++;

    return self;
}
397603
function isTrue(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && value !== true) {
        throw ValueException.unexpectedValue(assertionTypes.IS_TRUE, value, true, message, id);
    }
}
505151
function (regexp) {
        var res = maybeCallNative(nativeMatch, regexp, this);
        if (res.done) return res.value;

        var rx = anObject(regexp);
        var S = String(this);

        if (!rx.global) return regExpExec(rx, S);

        var fullUnicode = rx.unicode;
        rx.lastIndex = 0;
        var A = [];
        var n = 0;
        var result;
        while ((result = regExpExec(rx, S)) !== null) {
          var matchStr = String(result[0]);
          A[n] = matchStr;
          if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
          n++;
        }
        return n === 0 ? null : A;
      }
195219
function getRegExp(node) {

        if (node.value instanceof RegExp) {
            return node.value;
        } else if (typeof node.value === "string") {

            var parent = context.getAncestors().pop();
            if ((parent.type === "NewExpression" || parent.type === "CallExpression") &&
            parent.callee.type === "Identifier" && parent.callee.name === "RegExp") {

                // there could be an invalid regular expression string
                try {
                    return new RegExp(node.value);
                } catch (ex) {
                    return null;
                }

            }
        } else {
            return null;
        }

    }
1029232
protected function matchRegExp($regexp, $string, array &$params)
    {
        if (preg_match($regexp, $string, $params)) {
            $matched = strlen($params[0]);
            $this->filterMatchedParams($params);

            return $matched;
        } else {
            return false;
        }
    }
833689
public static boolean valueMatchesRegularExpression(String val, Pattern regexp) {
		Matcher m = regexp.matcher(val);

		try {
			return m.matches();
		} catch (StackOverflowError e) {
			e.printStackTrace();
			System.out.println("-> [" + val + "][" + regexp + "]");
			System.out.println("-> " + val.length());
			System.exit(0);
		}
		return false;
	}
1352303
function isRegExp(value) {
    return value && objectTypes[typeof value] && toString.call(value) == regexpClass || false;
  }
848149
function verify(context, node, pattern, flags) {
    try {
        let found = false

        new RegExpValidator({
            onLookaroundAssertionEnter(_start, kind) {
                if (kind === "lookbehind") {
                    found = true
                }
            },
        }).validatePattern(pattern, 0, pattern.length, flags.includes("u"))

        if (found) {
            context.report({ node, messageId: "forbidden" })
        }
    } catch (error) {
        //istanbul ignore else
        if (error.message.startsWith("Invalid regular expression:")) {
            return
        }
        //istanbul ignore next
        throw error
    }
}
1152979
function(sId) {

			//Match camelCase - case sensitive
			var idRegEx = /^[a-z][a-zA-Z]+$/;

			if (
				!sId || typeof sId !== 'string') {
				return false;
			}

			if (sId.match(idRegEx) && this.validateStringLength(sId, 6, 50)) {
				return true;
			}

			return false;
	}
156948
public void expectMatch(String name, String message, List<String> values) {
        String value = Optional.ofNullable(get(name)).orElse("");

        if (!(values).contains(value)) {
            addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.MATCH_VALUES_KEY.name(), name)));
        }
    }