private static UrlValidator createUrlValidatorWithRegex(final boolean allowLocalUrls, final String authorityValidationRegEx,
                                                            final boolean authorityValidationRegExCaseSensitive) {
        if (StringUtils.isEmpty(authorityValidationRegEx)) {
            return null;
        }

        val authorityValidator = new RegexValidator(authorityValidationRegEx, authorityValidationRegExCaseSensitive);
        val options = allowLocalUrls ? UrlValidator.ALLOW_LOCAL_URLS : 0;
        return new UrlValidator(authorityValidator, options);
    }
The factory to build a {@link org.apereo.cas.web.UrlValidator}.

@author swoeste
@since 5.2.0
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/SimpleUrlValidatorFactoryBean.java