RegexResult.match()
Returns the specified RegexMatch
object.
regexresult.match(index as Number) as RegexMatch or Nothing
Parameters
index
. Zero-based integerNumber
. The index of the match to retrieve
Returns
- Returns the requested
RegexMatch
object - If
index
is out of bounds then returnsNothing
Example
var t = "I love coffee. I hate melon."
var result = t.match(|love (\w+)\|hate (\w+)|)
print(result.match(0).value) # => "love coffee"
print(result.match(1).value) # => "hate melon"