public static Validator < CharSequence > regex ( @ NonNull final CharSequence errorMessage , @ NonNull final Pattern regex ) { return new RegexValidator ( errorMessage , regex ) ; }
Creates and returns a validator which allows to validate texts to ensure that they match a certain regular expression .