Modifier and Type | Field and Description |
---|---|
protected int |
charsMatched_ |
protected boolean |
didMatch_ |
protected int[] |
marks |
protected int |
matchFrom_ |
protected int |
numSubs_ |
protected StringLike |
src |
Modifier and Type | Method and Description |
---|---|
int |
charsMatched()
After a successful match, this returns the number of
characters in the match, or -1 if the match failed.
|
int |
charsMatched(int i)
Obtains the number of characters matched by backreference i, or
-1 if backreference i was not matched.
|
Object |
clone()
Create a field for field copy of this Object if this Object
implements the Cloneable interface.
|
void |
copyOutOf(RegRes r) |
boolean |
didMatch()
Contains true if the last match was successful.
|
boolean |
equals(RegRes r) |
String |
getString()
Obtain the text String that was matched against.
|
StringLike |
getStringLike()
Obtain the source StringLike object.
|
String |
left()
This returns the part of the string that preceeds the match,
or null if the match failed.
|
String |
left(int i)
This returns the part of the string that follows the ith
backreference, or null if the backreference did not match.
|
int |
matchedFrom()
After a successful match, this returns the location of
the first matching character, or -1 if the match failed.
|
int |
matchedFrom(int i)
Obtains the position backreference number i begins to match, or
-1 if backreference i was not matched.
|
int |
matchedTo()
This is matchedFrom()+charsMatched() after a successful match,
or -1 otherwise.
|
int |
matchedTo(int i)
This is either equal to matchedFrom(i)+charsMatched(i) if the match
was successful, or -1 if it was not.
|
int |
matchFrom()
An older name for matchedFrom.
|
int |
matchFrom(int i)
An older name for matchedFrom.
|
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.
|
String |
right()
This returns the part of the string that follows the match,
or null if the backreference did not match.
|
String |
right(int i)
This returns the string to the right of the ith backreference,
or null if the backreference did not match.
|
String |
stringMatched()
Obtains the match if successful, null otherwise.
|
String |
stringMatched(int i)
Obtains a substring matching the nth set
of parenthesis from the pattern.
|
String |
substring()
An older name for stringMatched().
|
String |
substring(int i)
An older name for stringMatched.
|
String |
toString()
Return a String representation of this object.
|
protected int[] marks
protected boolean didMatch_
protected StringLike src
protected int charsMatched_
protected int matchFrom_
protected int numSubs_
public RegRes()
public RegRes(RegRes r)
public String getString()
public StringLike getStringLike()
public String toString()
Object
public void copyOutOf(RegRes r)
public Object clone()
Object
public boolean equals(RegRes r)
public String stringMatched()
public int matchedFrom(int i)
public int charsMatched(int i)
public int matchedTo(int i)
public String stringMatched(int i)
public String left()
public String left(int i)
public String right()
public String right(int i)
public int matchedFrom()
public int charsMatched()
public int matchedTo()
public int numSubs()
public boolean didMatch()
public int matchFrom()
public String substring()
public int matchFrom(int i)
public String substring(int i)