|
XML Parser for Java 1.1.16 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.xml.omake.Regexp
Regular expression matching using non-deterministic finate automaton (NFA).
Special characters are `. * + ? [ ( ) | \'.
Parensises make groups of in a regular expression and applications can know
where in target text each group matched with getMatchedBeginnig() getMatchedEnd()
getMatchedString()
after match() exactMatch()
.
The 0th group means whole of this regular expression.
The Nth gorup is the inside of the Nth left parensis.
Constructor Summary | |
Regexp(java.lang.String regexp)
Constructor. |
Method Summary | |
boolean |
exactMatch(java.lang.String target)
|
int |
getMatchedBeginning(int index)
Return a start position in the target text matched to specified regular expression group. |
int |
getMatchedEnd(int index)
Return an end position in the target text matched to specified regular expression group. |
java.lang.String |
getMatchedString(int index)
Return an substring of the target text matched to specified regular expression group. |
int |
getNumberOfGroups()
Return the number of regular expression groups. |
static void |
main(java.lang.String[] argv)
Sample entry. |
int |
match(java.lang.String target)
|
java.lang.String |
toString()
Represents this instence in String. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Regexp(java.lang.String regexp) throws RegexpParseException
regexp
- A regular expressionMethod Detail |
public java.lang.String toString()
public int match(java.lang.String target)
public boolean exactMatch(java.lang.String target)
public int getMatchedBeginning(int index)
This method doesn't return valid value before calling match()/exactMatch()
.
index
- Less than getNumberOfGroups().getMatchedEnd(int)
,
getMatchedString(int)
,
getNumberOfGroups()
public int getMatchedEnd(int index)
This method doesn't return valid value before calling match()/exactMatch()
.
index
- Less than getNumberOfGroups().getMatchedBeginning(int)
,
getMatchedString(int)
,
getNumberOfGroups()
public java.lang.String getMatchedString(int index)
This method doesn't return valid value before calling match()/exactMatch()
.
index
- Less than getNumberOfGroups().getMatchedBeginning(int)
,
getMatchedEnd(int)
,
getNumberOfGroups()
public int getNumberOfGroups()
getMatchedBeginning(int)
,
getMatchedString(int)
,
getMatchedEnd(int)
public static void main(java.lang.String[] argv)
|
XML Parser for Java 1.1.16 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |