New regex method
This commit is contained in:
@@ -9,6 +9,14 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class Regex {
|
public class Regex {
|
||||||
|
public static boolean has(@Language("Regexp") String regex, String match) {
|
||||||
|
try {
|
||||||
|
regex(regex, match, 1);
|
||||||
|
return true;
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
public static String regex(@Language("Regexp") String regex, String match) throws NoSuchFieldException {
|
public static String regex(@Language("Regexp") String regex, String match) throws NoSuchFieldException {
|
||||||
return regex(regex, match, 1);
|
return regex(regex, match, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user