Collection of useful utilities for Java games and apps. A lot of interesting utilities that could maybe still find some use if you work with Java...
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.
|
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);
|
|
}
|
|
|
|
}
|
|
|