Construct the validator either for a single regular expression or a set (array) of regular expressions. By default validation is case sensitive but constructors are provided to allow case in-sensitive validation. For example to create a validator which does case in-sensitive validation for a set of regular expressions:
String[] regexs = new String[] {...}; RegexValidator validator = new RegexValidator(regexs, false);
true
or false
:boolean valid = validator.isValid(value);
String result = validator.validate(value);
String[] result = validator.match(value);
Cached instances pre-compile and re-use {@link Pattern}(s) - which according to the {@link Pattern} API are safe to use in a multi-threaded environment. @since Validator 1.4
|
|