Stay organized with collections
Save and categorize content based on your preferences.
PatternSyntaxException
open class PatternSyntaxException : IllegalArgumentException
Unchecked exception thrown to indicate a syntax error in a regular-expression pattern.
Summary
Public constructors |
Constructs a new instance of this class.
|
Public methods |
open String! |
Retrieves the description of the error.
|
open Int |
Retrieves the error index.
|
open String! |
Retrieves the erroneous regular-expression pattern.
|
Properties |
open String? |
Returns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern.
|
Public constructors
PatternSyntaxException
PatternSyntaxException(
desc: String!,
regex: String!,
index: Int)
Constructs a new instance of this class.
Parameters |
desc |
String!: A description of the error |
regex |
String!: The erroneous pattern |
index |
Int: The approximate index in the pattern of the error, or -1 if the index is not known |
Public methods
getDescription
open fun getDescription(): String!
Retrieves the description of the error.
Return |
String! |
The description of the error |
getIndex
open fun getIndex(): Int
Retrieves the error index.
Return |
Int |
The approximate index in the pattern of the error, or -1 if the index is not known |
getPattern
open fun getPattern(): String!
Retrieves the erroneous regular-expression pattern.
Return |
String! |
The erroneous pattern |
Properties
message
open val message: String?
Returns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern.
Return |
String? |
The full detail message |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# PatternSyntaxException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPatternSyntaxException\n======================\n\n```\nopen class PatternSyntaxException : IllegalArgumentException\n```\n\n|---|---|---|---|---|---------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||||\n| | ↳ | [java.lang.Exception](../../lang/Exception.html#) ||||\n| | | ↳ | [java.lang.RuntimeException](../../lang/RuntimeException.html#) |||\n| | | | ↳ | [java.lang.IllegalArgumentException](../../lang/IllegalArgumentException.html#) ||\n| | | | | ↳ | [java.util.regex.PatternSyntaxException](#) |\n\nUnchecked exception thrown to indicate a syntax error in a regular-expression pattern.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [PatternSyntaxException](#PatternSyntaxException(kotlin.String,%20kotlin.String,%20kotlin.Int))`(`desc:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `regex:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Constructs a new instance of this class. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getDescription](#getDescription())`()` Retrieves the description of the error. |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getIndex](#getIndex())`()` Retrieves the error index. |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getPattern](#getPattern())`()` Retrieves the erroneous regular-expression pattern. |\n\n| Properties ||\n|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | [message](#message:kotlin.String) Returns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern. |\n\nPublic constructors\n-------------------\n\n### PatternSyntaxException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nPatternSyntaxException(\n desc: String!, \n regex: String!, \n index: Int)\n```\n\nConstructs a new instance of this class.\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `desc` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: A description of the error |\n| `regex` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The erroneous pattern |\n| `index` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The approximate index in the pattern of the error, or `-1` if the index is not known |\n\nPublic methods\n--------------\n\n### getDescription\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getDescription(): String!\n```\n\nRetrieves the description of the error.\n\n| Return ||\n|-----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The description of the error |\n\n### getIndex\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getIndex(): Int\n```\n\nRetrieves the error index.\n\n| Return ||\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The approximate index in the pattern of the error, or `-1` if the index is not known |\n\n### getPattern\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getPattern(): String!\n```\n\nRetrieves the erroneous regular-expression pattern.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-----------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The erroneous pattern |\n\nProperties\n----------\n\n### message\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen val message: String?\n```\n\nReturns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | The full detail message |"]]