Class pat.RegRes
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
-
RegRes()
-
-
RegRes(RegRes)
-
-
charsMatched()
- After a successful match, this returns the number of
characters in the match, or -1 if the match failed.
-
charsMatched(int)
- Obtains the number of characters matched by backreference i, or
-1 if backreference i was not matched
-
clone()
-
-
didMatch()
- Contains true if the last match was successful.
-
equals(RegRes)
-
-
left()
- This returns the part of the string that preceeds the match,
or null if the match failed.
-
left(int)
- This returns the part of the string that follows the ith
backreference, or null if the backreference did not match.
-
matchFrom()
- After a successful match, this returns the location of
the first matching character, or -1 if the match failed.
-
matchFrom(int)
- Obtains the position backreference number i begins to match, or
-1 if backreference i was not matched.
-
numSubs()
- This returns the number of
backreferences (parenthesis) in the pattern,
i.e.
-
right()
- This returns the part of the string that follows the match,
or null if the backreference did not match.
-
right(int)
- This returns the string to the right of the ith backreference,
or null if the backreference did not match.
-
substring()
- Obtains the match if successful, null otherwise
-
substring(int)
- Obtains a substring matching the nth set
of parenthesis from the pattern.
-
toString()
-
RegRes
public RegRes()
RegRes
public RegRes(RegRes r)
toString
public String toString()
- Overrides:
- toString in class Object
clone
public Object clone()
- Overrides:
- clone in class Object
equals
public boolean equals(RegRes r)
substring
public String substring()
- Obtains the match if successful, null otherwise
matchFrom
public int matchFrom(int i)
- Obtains the position backreference number i begins to match, or
-1 if backreference i was not matched.
charsMatched
public int charsMatched(int i)
- Obtains the number of characters matched by backreference i, or
-1 if backreference i was not matched
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.
left
public String left()
- This returns the part of the string that preceeds the match,
or null if the match failed.
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.
right
public String right()
- This returns the part of the string that follows the match,
or null if the backreference did not match.
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.
matchFrom
public int matchFrom()
- After a successful match, this returns the location of
the first matching character, or -1 if the match failed.
charsMatched
public int charsMatched()
- After a successful match, this returns the number of
characters in the match, or -1 if the match failed.
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.
didMatch
public boolean didMatch()
- Contains true if the last match was successful.
All Packages Class Hierarchy This Package Previous Next Index