craftercms/commons · RegexUtils.java
java logo
public static boolean matchesAny(String str, List<String> regexes, boolean fullMatch) {
        if (CollectionUtils.isNotEmpty(regexes)) {
            for (String regex : regexes) {
                Pattern pattern = Pattern.compile(regex);
                Matcher matcher = pattern.matcher(str);

                if (fullMatch) {
                    if (matcher.matches()) {
                        return true;
                    }
                } else {
                    if (matcher.find()) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
Similar code snippets
1.
enasequence/sequencetools · Utils.java
Match rating: 69.5% · See similar code snippets
java logo
public static boolean isMatches(String regEx, String value) {
		Pattern pattern = Pattern.compile(regEx);
		Matcher matcher = pattern.matcher(value);
		return matcher.matches();
	}
2.
yoojia/NextInputs-Android · Texts.java
Match rating: 69.36% · See similar code snippets
java logo
public static boolean regexMatch(String input, String regex) {
        return Pattern.compile(regex).matcher(input).matches();
    }
3.
GojaFramework/goja · Validator.java
Match rating: 66.58% · See similar code snippets
java logo
public static boolean match(String regex, String value) {
        Pattern pattern = Pattern.compile(regex);
        return pattern.matcher(value).find();
    }
4.
dkpro/dkpro-jwpl · Strings.java
Match rating: 66.57% · See similar code snippets
java logo
public static boolean matches(String str, String regex) {
		return Pattern.compile(regex).matcher(str).matches();
	}
5.
apache/flink · SqlFunctionUtils.java
Match rating: 66.38% · See similar code snippets
java logo
public static Boolean regExp(String s, String regex){
		if (regex.length() == 0) {
			return false;
		}
		try {
			return (REGEXP_PATTERN_CACHE.get(regex)).matcher(s).find(0);
		} catch (Exception e) {
			LOG.error("Exception when compile and match regex:" +
				regex + " on: " + s, e);
			return false;
		}
	}
6.
graknlabs/grakn · AttributeTypeImpl.java
Match rating: 65.62% · See similar code snippets
java logo
private void checkInstancesMatchRegex(@Nullable String regex) {
        if (regex != null) {
            Pattern pattern = Pattern.compile(regex);
            instances().forEach(resource -> {
                String value = (String) resource.value();
                Matcher matcher = pattern.matcher(value);
                if (!matcher.matches()) {
                    throw TransactionException.regexFailure(this, value, regex);
                }
            });
        }
    }
7.
craftercms/commons · RegexUtils.java
Match rating: 65.54% · See similar code snippets
java logo
public static boolean matchesAny(String str, String... regexes) {
        if (ArrayUtils.isNotEmpty(regexes)) {
            return matchesAny(str, Arrays.asList(regexes));
        } else {
            return false;
        }
    }
8.
gosu-lang/gosu-lang · GosuStringUtil.java
Match rating: 65.33% · See similar code snippets
java logo
public static RegExpMatch match( String str, String regExp ) {
    Pattern pattern = Pattern.compile( regExp );
    Matcher matcher = pattern.matcher( str );
    if( matcher.matches() )
    {
      return new RegExpMatch( matcher );
    }
    else
    {
      return null;
    }
  }
9.
tommyettinger/RegExodus · Pattern.java
Match rating: 64.98% · See similar code snippets
java logo
public static boolean matches(String regex, CharSequence input) {
        Pattern p = Pattern.compile(regex);
        return p.matcher(input).matches();
    }
10.
nutzam/nutz · Regex.java
Match rating: 64.88% · See similar code snippets
java logo
public static boolean match(String regex, String value) {
        return getPattern(regex).matcher(value).find();
    }