* @param messageKey メッセージキー
* @throws ValidatorFormatException 正規表現パターンが不正な場合
*/
public RegexValidator(String regex, String messageKey) throws ValidatorFormatException {
super(messageKey);
if (regex == null) throw new ValidatorFormatException("RegexValidator: " + regex);
try {
this.pattern = Pattern.compile(regex);
} catch (PatternSyntaxException e) {
throw new ValidatorFormatException("RegexValidator: " + regex, e);
}
}