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