I was experimenting to use this regex pattern checking method as described in
How to check if a given Regex is valid?
import java.util.regex.Pattern
import java.util.regex.PatternSyntaxException
public class RegexTester {
public static void main(String[] arguments) {
String userInputPattern = arguments[0];
try {
Pattern.compile(userInputPattern);
} catch (PatternSyntaxException exception) {
System.err.println(exception.getDescription());
System.exit(1);
}
System.out.println("Syntax is ok.");
}
}
(using Google Web ToolKit) but I keep getting the "failed" message":
Plugin failed to connect to Development Mode server at 127.0.0.1:9997
whenever I use the Pattern.compile(String)
method.
Does anyone know what I'm doing wrong?