Packages

trait MatchData extends AnyRef

This class provides methods to access the details of a match.

Source
Regex.scala
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MatchData
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

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

  2. abstract def end: Int

    The index following the last matched character, or -1 if nothing was matched.

  3. abstract def groupCount: Int

    The number of capturing groups in the pattern.

    The number of capturing groups in the pattern. (For a given successful match, some of those groups may not have matched any input.)

  4. abstract val source: CharSequence

    The source from which the match originated

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

  6. abstract def start: Int

    The index of the first matched character, or -1 if nothing was matched

  7. abstract val groupNames: Seq[String]

    The names of the groups, or an empty sequence if none defined

    The names of the groups, or an empty sequence if none defined

    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.7) groupNames does not include inline group names, and should not be used anymore

Concrete Value Members

  1. def after(i: Int): CharSequence

    The char sequence after last character of match in group i, or null if nothing was matched for that group.

  2. def after: CharSequence

    Returns char sequence after last character of match, or null if nothing was matched.

  3. def before(i: Int): CharSequence

    The char sequence before first character of match in group i, or null if nothing was matched for that group.

  4. def before: CharSequence

    The char sequence before first character of match, or null if nothing was matched.

  5. def group(id: String): String

    Returns the group with the given name.

    Returns the group with the given name.

    Uses explicit group names when supplied; otherwise, queries the underlying implementation for inline named groups. Not all platforms support inline group names.

    id

    The group name

    returns

    The requested group

    Exceptions thrown

    IllegalArgumentException if the requested group name is not defined

  6. def group(i: Int): String

    The matched string in group i, or null if nothing was matched.

  7. def matched: String

    The matched string, or null if nothing was matched.

  8. def subgroups: List[String]

    All capturing groups, i.e., not including group(0).

  9. def toString(): String

    The matched string; equivalent to matched.toString.

    The matched string; equivalent to matched.toString.

    returns

    a String representation of the object.

    Definition Classes
    MatchData → AnyRef → Any