string.indexOfRegex()
Get the index of the first substring matching a provided regular expression within a String.
Signature
indexOfRegex(regex: String) => Number | Null
indexOfRegex(regex: String, start: Number) => Number | Null
Description
Returns the zero-based offset index for the first occurrence of a substring matching a provided regular expression within the calling String. Starts at an optional start position in the calling String. == Parameters
Parameter | Type | Required | Description |
---|---|---|---|
regex |
true |
Regular expression used to match substrings in the calling String. Supports Java regex. |
|
start |
Zero-based index of the character to start searching for matches. Defaults to
|