MatchResult

halotukozak.regex.MatchResult
final case class MatchResult

Result of a successful CaptureMatcher.matchWhole call: the spans captured by every numbered/named group in the pattern (see Regex.Group). Group 0 is always present and always spans the whole input, exactly like java.util.regex.Matcher.group(0).

Attributes

Source
Capture.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def group(index: Int): Option[(start: Int, end: Int)]

The span (start, end) captured by group index, or None if that group never participated in the match - e.g. it sits in an alternative branch that wasn't taken, or inside a */{0,n} repetition that ran zero times. Distinct from Some((p, p)), which means the group did participate but captured zero characters (e.g. (a?) matching "") - see Regex.Group's own doc comment for why this distinction matters.

The span (start, end) captured by group index, or None if that group never participated in the match - e.g. it sits in an alternative branch that wasn't taken, or inside a */{0,n} repetition that ran zero times. Distinct from Some((p, p)), which means the group did participate but captured zero characters (e.g. (a?) matching "") - see Regex.Group's own doc comment for why this distinction matters.

Attributes

Source
Capture.scala
def group(name: String): Option[(start: Int, end: Int)]

Like group, but by a (?...) group's name instead of its number.

Like group, but by a (?...) group's name instead of its number.

Attributes

Source
Capture.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala