|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xmlmind.util.RegexMatch
public final class RegexMatch
Input subsequence captured by the given group during the previous match
operation. See java.util.regex.Matcher.
Example of use:
Pattern p = Pattern.compile(regexp);
Matcher matcher = p.matcher(string);
if (matcher.matches()) {
RegexMatch[] match = RegexMatch.getAll(matcher);
for (int j = 0; j < match.length; ++j) {
System.out.println("\t$" + j + "='" + match[j].text + "'");
}
}
| Field Summary | |
|---|---|
int |
endIndex
Index of the end of the input subsequence. |
int |
startIndex
Index of the start of the input subsequence. |
java.lang.String |
text
Text contained in the input subsequence. |
| Constructor Summary | |
|---|---|
RegexMatch(int startIndex,
int endIndex,
java.lang.String text)
Constructor. |
|
| Method Summary | |
|---|---|
static RegexMatch[] |
getAll(java.util.regex.Matcher matcher)
Returns all input subsequence captured during last match operation performed by specified matcher. |
java.lang.String |
toString()
Returns text. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final int startIndex
public final int endIndex
public final java.lang.String text
| Constructor Detail |
|---|
public RegexMatch(int startIndex,
int endIndex,
java.lang.String text)
startIndex - index of the start of the input subsequenceendIndex - index of the end of the input subsequencetext - text contained in the input subsequence| Method Detail |
|---|
public static RegexMatch[] getAll(java.util.regex.Matcher matcher)
Returned array is empty if matcher has never been used or if input sequence does not match pattern.
public java.lang.String toString()
text.
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||