@Override
    public String transform(final String username) {
        val matcher = this.pattern.matcher(username);
        if (matcher.find()) {
            throw new PreventedException("Unable to accept username " + username);
        }
        return username.trim();
    }
A transformer that matches the username against a given regex pattern
and throws back an error if a match is found.

@author Misagh Moayyed
@since 6.4.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/transforms/BlockingPrincipalNameTransformer.java