public static void matchesPattern(CharSequence input, String pattern) {
        if (Pattern.matches(pattern, input) == false) {
            throw new IllegalArgumentException(String.format(DEFAULT_MATCHES_PATTERN_EX, input, pattern));
        }
    }
<p>Validate that the specified argument character sequence matches the specified regular
expression pattern; otherwise throwing an exception.</p>

<pre>Validate.matchesPattern("hi", "[a-z]*");</pre>

<p>The syntax of the pattern is the one used in the {@link Pattern} class.</p>

@param input  the character sequence to validate, not null
@param pattern  the regular expression pattern, not null
@throws IllegalArgumentException if the character sequence does not match the pattern
@see #matchesPattern(CharSequence, String, String, Object...)

@since 3.0
android/android_framework/base/src/main/java/lang3/Validate.java