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 : java.lang.CharSequence
Returns char sequence after last character of match, or null if nothing was matched
def after (i : Int) : java.lang.CharSequence
The char sequence after last character of match in group i, or null if nothing was matched for that group
def before : java.lang.CharSequence
The char sequence before first character of match, or null if nothing was matched
def before (i : Int) : java.lang.CharSequence
The char sequence before first character of match in group i, or null if nothing was matched for that group
abstract def end (i : Int) : Int
The index following the last matched character in group i, or -1 if nothing was matched for that group
abstract def end : Int
The index of the last matched character, or -1 if nothing was matched
def group (id : java.lang.String) : java.lang.String
Returns the group with given name
def group (i : Int) : java.lang.String
The matched string in group i, or null if nothing was matched
abstract def groupCount : Int
The number of subgroups in the pattern (not all of these need to match!)
def matched : java.lang.String
The matched string, of null if nothing was matched
abstract def start : Int
The index of the first matched character, or -1 if nothing was matched
abstract def start (i : Int) : Int
The index of the first matched character in group i, or -1 if nothing was matched for that group
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 groupCount : Int
The number of subgroups in the pattern (not all of these need to match!)

abstract def start : Int
The index of the first matched character, or -1 if nothing was matched

abstract def start(i : Int) : Int
The index of the first matched character in group i, or -1 if nothing was matched for that group

abstract def end : Int
The index of the last matched character, or -1 if nothing was matched

abstract def end(i : Int) : Int
The index following the last matched character in group i, or -1 if nothing was matched for that group

def matched : java.lang.String
The matched string, of null if nothing was matched

def group(i : Int) : java.lang.String
The matched string in group i, or null if nothing was matched

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, or null if nothing was matched

def before(i : Int) : java.lang.CharSequence
The char sequence before first character of match in group i, or null if nothing was matched for that group

def after : java.lang.CharSequence
Returns char sequence after last character of match, or null if nothing was matched

def after(i : Int) : java.lang.CharSequence
The char sequence after last character of match in group i, or null if nothing was matched for that group

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