All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pat.RegRes

java.lang.Object
   |
   +----pat.RegRes

public class RegRes
extends Object
implements Cloneable
Shareware: package pat Copyright 1996, Steven R. Brandt

Used to store a result from Regex


Constructor Index

 o RegRes()
 o RegRes(RegRes)

Method Index

 o charsMatched()
After a successful match, this returns the number of characters in the match, or -1 if the match failed.
 o charsMatched(int)
Obtains the number of characters matched by backreference i, or -1 if backreference i was not matched
 o clone()
 o didMatch()
Contains true if the last match was successful.
 o equals(RegRes)
 o left()
This returns the part of the string that preceeds the match, or null if the match failed.
 o left(int)
This returns the part of the string that follows the ith backreference, or null if the backreference did not match.
 o matchFrom()
After a successful match, this returns the location of the first matching character, or -1 if the match failed.
 o matchFrom(int)
Obtains the position backreference number i begins to match, or -1 if backreference i was not matched.
 o numSubs()
This returns the number of backreferences (parenthesis) in the pattern, i.e.
 o right()
This returns the part of the string that follows the match, or null if the backreference did not match.
 o right(int)
This returns the string to the right of the ith backreference, or null if the backreference did not match.
 o substring()
Obtains the match if successful, null otherwise
 o substring(int)
Obtains a substring matching the nth set of parenthesis from the pattern.
 o toString()

Constructors

 o RegRes
  public RegRes()
 o RegRes
  public RegRes(RegRes r)

Methods

 o toString
  public String toString()
Overrides:
toString in class Object
 o clone
  public Object clone()
Overrides:
clone in class Object
 o equals
  public boolean equals(RegRes r)
 o substring
  public String substring()
Obtains the match if successful, null otherwise

 o matchFrom
  public int matchFrom(int i)
Obtains the position backreference number i begins to match, or -1 if backreference i was not matched.

 o charsMatched
  public int charsMatched(int i)
Obtains the number of characters matched by backreference i, or -1 if backreference i was not matched

 o substring
  public String substring(int i)
Obtains a substring matching the nth set of parenthesis from the pattern. See numSubs(void), or null if the nth backrefence did not match.

 o left
  public String left()
This returns the part of the string that preceeds the match, or null if the match failed.

 o left
  public String left(int i)
This returns the part of the string that follows the ith backreference, or null if the backreference did not match.

 o right
  public String right()
This returns the part of the string that follows the match, or null if the backreference did not match.

 o right
  public String right(int i)
This returns the string to the right of the ith backreference, or null if the backreference did not match.

 o matchFrom
  public int matchFrom()
After a successful match, this returns the location of the first matching character, or -1 if the match failed.

 o charsMatched
  public int charsMatched()
After a successful match, this returns the number of characters in the match, or -1 if the match failed.

 o numSubs
  public int numSubs()
This returns the number of backreferences (parenthesis) in the pattern, i.e. the pattern "(ab)" has one, the pattern "(a)(b)" has two, etc.

 o didMatch
  public boolean didMatch()
Contains true if the last match was successful.


All Packages  Class Hierarchy  This Package  Previous  Next  Index