Home » Core Java » util » regex » PatternSyntaxException

PatternSyntaxException

java.util.regex.PatternSyntaxException Example

In this example we will discuss about java.util.regex.PatternSyntaxException. This exception is thrown when a regex (a regular exception) pattern is not correct, i.e. has syntax errors. The PatternSyntaxException extends IllegalArgumentException, which means that an argument passed to a method is illegal or inappropriate. Just like IllegalArgumentException, PatternSyntaxException is a runtime exception (indirect subclass of RuntimeException). This means that the try-catch ...

Read More »