Packages

  • package root

    This is the documentation for the Scala standard library.

    This is the documentation for the Scala standard library.

    Package structure

    The scala package contains core types like Int, Float, Array or Option which are accessible in all Scala compilation units without explicit qualification or imports.

    Notable packages include:

    Other packages exist. See the complete list on the right.

    Additional parts of the standard library are shipped as separate libraries. These include:

    • scala.reflect - Scala's reflection API (scala-reflect.jar)
    • scala.xml - XML parsing, manipulation, and serialization (scala-xml.jar)
    • scala.collection.parallel - Parallel collections (scala-parallel-collections.jar)
    • scala.util.parsing - Parser combinators (scala-parser-combinators.jar)
    • scala.swing - A convenient wrapper around Java's GUI framework called Swing (scala-swing.jar)

    Automatic imports

    Identifiers in the scala package and the scala.Predef object are always in scope by default.

    Some of these identifiers are type aliases provided as shortcuts to commonly used classes. For example, List is an alias for scala.collection.immutable.List.

    Other aliases refer to classes provided by the underlying platform. For example, on the JVM, String is an alias for java.lang.String.

    Definition Classes
    root
  • package scala

    Core Scala types.

    Core Scala types. They are always available without an explicit import.

    Definition Classes
    root
  • package util
    Definition Classes
    scala
  • package matching
    Definition Classes
    util
  • object Regex extends java.io.Serializable

    This object defines inner classes that describe regex matches and helper objects.

    This object defines inner classes that describe regex matches and helper objects.

    Definition Classes
    matching
  • Groups
  • Match
  • MatchData
  • MatchIterator

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

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 groupNames: Seq[String]

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

  5. abstract val source: CharSequence

    The source from which the match originated

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

  7. abstract def start: Int

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

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