Rogue: Savage Rats, a retro-themed dungeon crawler
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.util.string.filtering;
|
|
|
|
|
|
public class RegexCharFilter implements CharFilter {
|
|
|
|
private final String formula;
|
|
|
|
|
|
public RegexCharFilter(String regex) {
|
|
this.formula = regex;
|
|
}
|
|
|
|
|
|
@Override
|
|
public boolean isValid(char c)
|
|
{
|
|
return Character.toString(c).matches(formula);
|
|
}
|
|
|
|
}
|
|
|