W3cubDocs

/Kotlin

MatchResult

interface MatchResult

Represents the results from a single regular expression match.

Types

Destructured

class Destructured

Provides components for destructuring assignment of group values.

Properties

destructured

open val destructured: Destructured

An instance of MatchResult.Destructured wrapper providing components for destructuring assignment of group values.

groupValues

abstract val groupValues: List<String>

A list of matched indexed group values.

groups

abstract val groups: MatchGroupCollection

A collection of groups matched by the regular expression.

range

abstract val range: IntRange

The range of indices in the original string where match was captured.

value

abstract val value: String

The substring from the input string captured by this match.

Functions

next

abstract fun next(): MatchResult?

Returns a new MatchResult with the results for the next match, starting at the position at which the last match ended (at the character after the last matched character).

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-match-result/