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.
22 lines
310 B
22 lines
310 B
10 years ago
|
package mightypork.utils.string.validation;
|
||
|
|
||
|
|
||
|
public class CharFilterRegex implements CharFilter {
|
||
|
|
||
|
private final String formula;
|
||
|
|
||
|
|
||
|
public CharFilterRegex(String regex)
|
||
|
{
|
||
|
this.formula = regex;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public boolean isValid(char c)
|
||
|
{
|
||
|
return Character.toString(c).matches(formula);
|
||
|
}
|
||
|
|
||
|
}
|