starwave.util.regexp
Class Result

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

public class Result
extends java.lang.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 Summary
 java.lang.String getMatch()
          Returns the text of the matched string.
 java.lang.String getMatch(int n)
          Returns the text of the nth parenthesized substring match in the regular expression.
 int getMatchEnd()
          Returns the ending position of the matched string.
 int getMatchEnd(int n)
          Returns the ending position of the nth parenthesized substring match in the regular expression.
 int getMatchStart()
          Returns the starting position of the matched string.
 int getMatchStart(int n)
          Returns the starting position of the nth parenthesized substring match in the regular expression.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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

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

getMatch

public java.lang.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

getMatchStart

public int getMatchStart()
Returns the starting position of the matched string.

Returns:
the starting position of the matched string

getMatchEnd

public int getMatchEnd()
Returns the ending position of the matched string.

Returns:
the ending position of the matched string

getMatch

public java.lang.String getMatch()
Returns the text of the matched string.

Returns:
the text of the matched string

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object