You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
306 B
21 lines
306 B
10 years ago
|
package mightypork.utils.string.validation;
|
||
|
|
||
|
|
||
|
public class CharValidatorRegex implements CharValidator {
|
||
|
|
||
|
private String formula;
|
||
|
|
||
|
|
||
|
public CharValidatorRegex(String regex) {
|
||
|
this.formula = regex;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public boolean isValid(char c)
|
||
|
{
|
||
|
return Character.toString(c).matches(formula);
|
||
|
}
|
||
|
|
||
|
}
|