scala.util.matching.Regex

trait MatchData

[source: scala/util/matching/Regex.scala]

trait MatchData
extends AnyRef
This class provides methods to access the details of a match.
Direct Known Subclasses:
Regex.Match, Regex.MatchIterator

Value Summary
abstract val groupNames : Seq[java.lang.String]
The names of the groups, or some empty sequence if one defined
abstract val source : java.lang.CharSequence
The source from where the match originated
Method Summary
def after (i : Int) : java.lang.CharSequence
The char sequence after last character of match in group i
def after : java.lang.CharSequence
Returns char sequence after last character of match
def before (i : Int) : java.lang.CharSequence
The char sequence before first character of match in group i
def before : java.lang.CharSequence
The char sequence before first character of match
abstract def end (i : Int) : Int
The index following the last matched character in group i
abstract def end : Int
The index of the last matched character
def group (i : Int) : java.lang.String
The matched string in group i
def group (id : java.lang.String) : java.lang.String
Returns the group with given name
abstract def groupCount : Int
The number of subgroups
def matched : java.lang.String
The matched string
abstract def start : Int
The index of the first matched character
abstract def start (i : Int) : Int
The index of the first matched character in group i
def subgroups : List[java.lang.String]
All matched subgroups, i.e. not including group(0)
override def toString : java.lang.String
The matched string; equivalent to matched.toString
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
abstract val source : java.lang.CharSequence
The source from where the match originated

abstract val groupNames : Seq[java.lang.String]
The names of the groups, or some empty sequence if one defined

Method Details
abstract def start : Int
The index of the first matched character

abstract def start(i : Int) : Int
The index of the first matched character in group i

abstract def end : Int
The index of the last matched character

abstract def groupCount : Int
The number of subgroups

abstract def end(i : Int) : Int
The index following the last matched character in group i

def matched : java.lang.String
The matched string

def group(i : Int) : java.lang.String
The matched string in group i

def subgroups : List[java.lang.String]
All matched subgroups, i.e. not including group(0)

def before : java.lang.CharSequence
The char sequence before first character of match

def before(i : Int) : java.lang.CharSequence
The char sequence before first character of match in group i

def after : java.lang.CharSequence
Returns char sequence after last character of match

def after(i : Int) : java.lang.CharSequence
The char sequence after last character of match in group i

def group(id : java.lang.String) : java.lang.String
Returns the group with given name
Parameters
id - The group name
Returns
The requested group
Throws
<code>NoSuchElementException</code> - if the requested group name is not defined

override def toString : java.lang.String
The matched string; equivalent to matched.toString