private static String parseCNValue(final String name) {
        val matcher = RegexUtils.createPattern("cn=(\\w+)").matcher(name);
        if (matcher.find()) {
            val commonName = matcher.group(1);
            return commonName.toUpperCase(Locale.ENGLISH);
        }
        return null;
    }
This is {@link SamlAssertionRealmCodec}.
Parse the realm from a SAML assertion.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/support/saml/SamlAssertionRealmCodec.java