Code example for PatternSyntaxException

Methods: getMessage

0
            try { 
                // -- patch and compile expression 
                _pattern = Pattern.compile(rexpr);
            } catch (PatternSyntaxException ex) {
                String err = "RegExp Syntax error: ";
                err += ex.getMessage();
                err += " ; error occured with the following "
                        + "regular expression: " + rexpr;
 
                IllegalArgumentException iae = new IllegalArgumentException(err);
                iae.initCause(ex);
                throw iae;
            } 
        } 
    } 
 
    /** 
     * Returns true if the given String is matched by the regular expression of 
     * this RegExpEvaluator 
     *  
Contextual code suggestions in your IDE  Get Codota for Java