Class regexp.Result
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class regexp.Result

java.lang.Object
   |
   +----regexp.Result

public class Result
extends Object
A Regexp result class. This is what's returned from a successful Regexp match or search operation. This contains methods to return the beginning and ending positions of the match, as well as the actual text of the match. It is also possible get the beginning, end and text of any of the submatches, as specified with the \( and \) notations.

Method Index

 o getMatch()
Returns the text of the matched string.
 o getMatch(int)
Returns the text of the nth parenthesized substring match in the regular expression.
 o getMatchEnd()
Returns the ending position of the matched string.
 o getMatchEnd(int)
Returns the ending position of the nth parenthesized substring match in the regular expression.
 o getMatchStart()
Returns the starting position of the matched string.
 o getMatchStart(int)
Returns the starting position of the nth parenthesized substring match in the regular expression.
 o toString()

Methods

 o getMatchStart
  public int getMatchStart(int n)
Returns the starting position of the nth parenthesized substring match in the regular expression. The 0th substring is the entire match.
Returns:
the starting position of the nth substring
Throws: NoSuchMatchException
if n is out of range
 o getMatchEnd
  public int getMatchEnd(int n)
Returns the ending position of the nth parenthesized substring match in the regular expression. The 0th substring is the entire match.
Returns:
the end position of the nth substring
Throws: NoSuchMatchException
if n is out of range
 o getMatch
  public String getMatch(int n)
Returns the text of the nth parenthesized substring match in the regular expression. The 0th substring is the entire match.
Returns:
the text of the nth substring
Throws: NoSuchMatchException
if n is out of range
 o getMatchStart
  public int getMatchStart()
Returns the starting position of the matched string.
Returns:
the starting position of the matched string
 o getMatchEnd
  public int getMatchEnd()
Returns the ending position of the matched string.
Returns:
the ending position of the matched string
 o getMatch
  public String getMatch()
Returns the text of the matched string.
Returns:
the text of the matched string
 o toString
  public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index