W3cubDocs

/Kotlin

MatchResult

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
interface MatchResult

Represents the results from a single regular expression match.

Types

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

Destructured

Provides components for destructuring assignment of group values.

class Destructured

Properties

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

destructured

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

open val destructured: Destructured
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

groups

A collection of groups matched by the regular expression.

abstract val groups: MatchGroupCollection
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

groupValues

A list of matched indexed group values.

abstract val groupValues: List<String>
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

range

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

abstract val range: IntRange
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

value

The substring from the input string captured by this match.

abstract val value: String

Functions

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

next

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).

abstract fun next(): MatchResult?

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