Element that must match the regular expression
@param regex regular expression
@deprecated Use the version that takes an example value
545894
@Deprecated
    public PactDslJsonArray stringMatcher(String regex) {
      generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(1), new RandomStringGenerator(10));
      stringMatcher(regex, new Generex(regex).random());
      return this;
    }
1164497
@GwtIncompatible("java.util.regex.Pattern")
  public void containsMatch(Pattern regex) {
    if (!regex.matcher(actual()).find()) {
      failWithActual("expected to contain a match for", regex);
    }
  }
808324
public static Condition matchText(final String regex) {
    return new Condition("match text") {
      @Override
      public boolean apply(Driver driver, WebElement element) {
        return Html.text.matches(element.getText(), regex);
      }

      @Override
      public String toString() {
        return name + " '" + regex + '\'';
      }
    };
  }
1214640
@GwtIncompatible("java.util.regex.Pattern")
  public void matches(Pattern regex) {
    if (!regex.matcher(actual()).matches()) {
      failWithActual("expected to match", regex);
    }
  }
586997
public static int preg_match(String regex, String subject) {
        Pattern p = Pattern.compile(regex);
        return preg_match(p, subject);
    }
175928
public static boolean contains(String regex, CharSequence content) {
		if (null == regex || null == content) {
			return false;
		}

		final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
		return contains(pattern, content);
	}
104530
public static String delPre(String regex, CharSequence content) {
		if (null == content || null == regex) {
			return StrUtil.str(content);
		}

		// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
		final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
		Matcher matcher = pattern.matcher(content);
		if (matcher.find()) {
			return StrUtil.sub(content, matcher.end(), content.length());
		}
		return StrUtil.str(content);
	}
956454
public final void setRegex(@NonNull final Pattern regex) {
        Condition.INSTANCE.ensureNotNull(regex, "The regular expression may not be null");
        this.regex = regex;
    }
439374
@GwtIncompatible("java.util.regex.Pattern")
  public void doesNotContainMatch(Pattern regex) {
    Matcher matcher = regex.matcher(actual());
    if (matcher.find()) {
      failWithoutActual(
          fact("expected not to contain a match for", regex),
          fact("but contained", matcher.group()),
          fact("full string", actualCustomStringRepresentationForPackageMembersToCall()));
    }
  }
614996
function matches(regex, str) {
    var ret = [];
    var match = regex.exec(str);
    while (match !== null) {
        ret.push({
            full: match[0],
            inner: match[1]
        });
        match = regex.exec(str);
    }
    return ret;
}
767865
public static boolean matches(String pattern, String value) {
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(value);
        return m.matches();
    }
430475
public static <T extends CharSequence> T validateMatchRegex(String regex, T value, String errorMsg) throws ValidateException {
		if (false == isMactchRegex(regex, value)) {
			throw new ValidateException(errorMsg);
		}
		return value;
	}
644297
public static boolean isValidRegex(final String pattern) {
        try {
            if (pattern != null) {
                Pattern.compile(pattern);
                return true;
            }
        } catch (final PatternSyntaxException exception) {
            LOGGER.debug("Pattern [{}] is not a valid regex.", pattern);
        }
        return false;
    }
1047046
public static String match(String pattern, String reg) {

        String match = null;
        List<String> matches = match(pattern, reg, 0);
        if (null != matches && matches.size() > 0) {
            match = matches.get(0);
        }
        return match;
    }
142323
protected void validateRegex(String field, String regExpression, String errorKey, String errorMessage) {
		validateRegex(field, regExpression, true, errorKey, errorMessage);
	}
797323
private String convertPerlToJavaRegex(String regex) {
		regex = regex.substring(1);
		int lastIndex = regex.lastIndexOf('/');
		regex = regex.substring(0, lastIndex);
		return regex;
	}
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;
        }

    }