Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

PatternSyntaxException

extends IllegalArgumentException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ java.lang.IllegalArgumentException
           ↳ java.util.regex.PatternSyntaxException

Class Overview

Encapsulates a syntax error that occurred during the compilation of a Pattern . Might include a detailed description, the original regular expression, and the index at which the error occurred.

Summary

Public Constructors
PatternSyntaxException ( String description, String pattern, int index)
Creates a new PatternSyntaxException for a given message, pattern, and error index.
Public Methods
String getDescription ()
Returns the description of the syntax error, or null if the description is not known.
int getIndex ()
Returns the character index around which the error occurred, or -1 if the index is not known.
String getMessage ()
Returns a detailed error message for the exception.
String getPattern ()
Returns the syntactically incorrect regular expression.
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public PatternSyntaxException ( String description, String pattern, int index)

Added in API level 1

Creates a new PatternSyntaxException for a given message, pattern, and error index.

Parameters
description the description of the syntax error, or null if the description is not known.
pattern the syntactically incorrect regular expression, or null if the regular expression is not known.
index the character index around which the error occurred, or -1 if the index is not known.

Public Methods

public String getDescription ()

Added in API level 1

Returns the description of the syntax error, or null if the description is not known.

Returns
  • the description.

public int getIndex ()

Added in API level 1

Returns the character index around which the error occurred, or -1 if the index is not known.

Returns
  • the index.

public String getMessage ()

Added in API level 1

Returns a detailed error message for the exception. The message is potentially multi-line, and it might include a detailed description, the original regular expression, and the index at which the error occurred.

Returns
  • the error message.

public String getPattern ()

Added in API level 1

Returns the syntactically incorrect regular expression.

Returns
  • the regular expression.