public boolean matches(String pattern, String source) {
        if (pattern == null) {
            throw new IllegalArgumentException("pattern argument cannot be null.");
        }
        Pattern p = Pattern.compile(pattern, caseInsensitive ? CASE_INSENSITIVE : DEFAULT);
        Matcher m = p.matcher(source);
        return m.matches();
    }
Simple implementation that merely uses the default pattern comparison logic provided by the
JDK.
<p/>This implementation essentially executes the following:
<pre>
Pattern p = Pattern.compile(pattern, Pattern.DOTALL);
Matcher m = p.matcher(source);
return m.matches();</pre>

@param pattern the pattern to match against
@param source  the source to match
@return {@code true} if the source matches the required pattern, {@code false} otherwise.
core/src/main/java/org/apache/shiro/util/RegExPatternMatcher.java