MatchGroupCollection

interface MatchGroupCollection : Collection<MatchGroup?>

Represents a collection of captured groups in a single match of a regular expression.

This collection has size of groupCount + 1 where groupCount is the count of groups in the regular expression. Groups are indexed from 1 to groupCount and group with the index 0 corresponds to the entire match.

An element of the collection at the particular index can be null, if the corresponding group in the regular expression is optional and there was no match captured by that group.

Functions

contains
Link copied to clipboard
abstract operator fun contains(element: MatchGroup?): Boolean
containsAll
Link copied to clipboard
abstract fun containsAll(elements: Collection<MatchGroup?>): Boolean
get
Link copied to clipboard
abstract operator fun get(index: Int): MatchGroup?

Returns a group with the specified index.

isEmpty
Link copied to clipboard
abstract fun isEmpty(): Boolean
iterator
Link copied to clipboard
abstract operator override fun iterator(): Iterator<MatchGroup?>

Properties

size
Link copied to clipboard
abstract val size: Int

Inheritors

MatchNamedGroupCollection
Link copied to clipboard

Extensions

get
Link copied to clipboard
operator fun MatchGroupCollection.get(name: String): MatchGroup?

Returns a named group with the specified name.