Value that must match the regular expression
@param regex regular expression
@param value example value to use for generated bodies
766438
public static PactDslRootValue stringMatcher(String regex, String value) {
    if (!value.matches(regex)) {
      throw new InvalidMatcherException(EXAMPLE + value + "\" does not match regular expression \"" +
              regex + "\"");
    }
    PactDslRootValue rootValue = new PactDslRootValue();
    rootValue.setValue(value);
    rootValue.setMatcher(rootValue.regexp(regex));
    return rootValue;
  }
1232715
public boolean isMatched(String value)
    {
        if (value == null)
            return false;
        if ((_match != null)) {
            for (int i = 0; i < _match.length; i++) {
                if (value.equals(_match[i]))
                    return true;
            }
        }
        else {
            if (_defaultSelections != null) {
                return (_defaultSelections.contains(value));
            }
        }

        return false;

    }
1214640
@GwtIncompatible("java.util.regex.Pattern")
  public void matches(Pattern regex) {
    if (!regex.matcher(actual()).matches()) {
      failWithActual("expected to match", regex);
    }
  }
767865
public static boolean matches(String pattern, String value) {
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(value);
        return m.matches();
    }
142323
protected void validateRegex(String field, String regExpression, String errorKey, String errorMessage) {
		validateRegex(field, regExpression, true, errorKey, errorMessage);
	}
383797
public static boolean isMatch(final String regex, final CharSequence input) {
        return input != null && input.length() > 0 && Pattern.matches(regex, input);
    }
270623
@Factory
    public static Matcher<Proc> raises(String regex) {
        return raises(IsThrowable.throwable(regex));
    }
718602
public static Predicate<String> matchesRegex(final String regex) {
		final Pattern pattern = Pattern.compile(regex);
		return matchesRegex(pattern);
	}
529731
def match(pattern):
    
    regex = re.compile(pattern)

    def validate(value):
        if not regex.match(value):
            return e("{} does not match the pattern {}", value, pattern)
    return validate
1362314
public static boolean isValid(final String value) {
        if (value == null) {
            return true;
        }
        final String uuidPattern = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-" + "[0-9a-f]{4}-[0-9a-f]{12}$";
        return Pattern.matches(uuidPattern, value);
    }
959889
public static boolean isValidStringMatchingRegex(final String value, final String expression) {

		Pattern pattern = patterns.get(expression);

		if (pattern == null) {

			pattern = Pattern.compile(expression);
			patterns.put(expression, pattern);
		}

		return (value != null && pattern.matcher(value).matches());
	}
408317
public static void p(int i, Regex r) {
        if (0 == i) {
            System.out.println(i + ": " + r.stringMatched());
        } else {
            System.out.println(i + ": " + r.stringMatched(i));
        }
    }
946092
public static Constraint pattern(final Object regex) {
		return new Constraint("pattern", patternPayload(regex)) {
			public boolean isValid(Object actualValue) {
				if (actualValue != null) {
					if (regex != null && regex instanceof String) {
						if (!(actualValue instanceof String) || !((String) actualValue).matches((String) regex)) {
							return false;
						}
					}
				}
				return true;
			}
		};
	}
612492
boolean matches(String value) {
    if (pattern == null) {
      return true;
    }
    return pattern.matcher(value).matches();
  }
50792
public static String format(final String value, String... params) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        Pattern p = Pattern.compile("\\{(\\w+)}");
        Matcher m = p.matcher(value);
        String result = value;
        while (m.find()) {
            int paramNumber = Integer.parseInt(m.group(1));
            if (params == null || paramNumber >= params.length) {
                throw new IllegalArgumentException("params does not have value for " + m.group());
            }
            result = result.replace(m.group(), params[paramNumber]);
        }
        return result;
    }
1352303
function isRegExp(value) {
    return value && objectTypes[typeof value] && toString.call(value) == regexpClass || false;
  }
1158550
function(value, text) {
      // escape regex characters
      text = text.replace($.fn.form.settings.regExp.escape, "\\$&");
      return (value.search( new RegExp(text, 'i') ) !== -1);
    }