java/sql-dk/src/info/globalcode/sql/dk/CLIOptions.java
branchv_0
changeset 63 3b9ec9c23a37
parent 54 53020d0bd2e4
child 69 0befec5034c2
--- a/java/sql-dk/src/info/globalcode/sql/dk/CLIOptions.java	Thu Dec 26 00:18:03 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/CLIOptions.java	Thu Dec 26 00:58:00 2013 +0100
@@ -25,6 +25,8 @@
 import java.util.Collection;
 import java.util.EnumSet;
 import java.util.List;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
 
 /**
  *
@@ -104,6 +106,11 @@
 			e.addProblem(new InvalidOptionsException.OptionProblem("Named and numbered parameters can not be used together in one command."));
 		}
 
+		try {
+			Pattern.compile(namePrefix + "test" + nameSuffix);
+		} catch (PatternSyntaxException regexException) {
+			e.addProblem(new InvalidOptionsException.OptionProblem("Ivalid regular expression in name prefix or suffix", regexException));
+		}
 
 		if (e.hasProblems()) {
 			throw e;