|
RegularExpression v1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--RegularExpression.RE
The RE class handles standard PERL-type regular expression operations.
RE pattern matching and escape characters list: /d ANY DIGIT /D ANY NON-DIGIT /s ANY TYPE OF WHITESPACE /S ANY TYPE OF NON-WHITESPACE /w ANY TYPE OF ALPHANUMERIC /W ANY TYPE OF NON-ALPHANUMERIC . ANY NON NEWLINE CHARACTER #x[0-9A-F]+ HEX REPRESENTATION OF A CHARACTER /? WHERE ? IS ANY OTHER CHARACTER YIELDS THAT CHARACTER * 0 OR MORE TIMES + 1 OR MORE TIMES ? 0 OR 1 TIMES {M} M TIMES {M,} AT LEAST M TIMES {M,N} AT LEAST M AND AT MOST N TIMES (N >= M) [al-z] CHARACTER LIST, INDIVIDUAL CHARACTERS OR CHARACTER RANGES
Constructor Summary | |
RE()
Empty constructor. |
|
RE(java.lang.String re,
boolean casesensitive)
Contructs a regular expression handler with the specified regular expression (as a string) and a boolean denoting case-sensitivity for operations. |
Method Summary | |
boolean |
beginningMatches(java.lang.String input)
Returns a boolean value specifying whether the beginning of the specified string matches the regular expression or not. |
java.lang.Object[] |
beginningMatchesWithLength(java.lang.String input)
Returns a boolean value specifying whether the beginning of the specified string matches the regular expression or not. |
RegularExpression.NFA |
getAutomaton()
Returns the regular expression automaton. |
int |
indexOf(java.lang.String input,
int offset)
Returns the index of the first instance of the regular expression after the offset. |
boolean |
matches(java.lang.String input)
Returns a boolean value specifying whether the specified string matches the regular expression or not. |
java.lang.Object[] |
matchesWithFailPoint(java.lang.String input)
Returns a boolean value specifying whether the specified string matches the regular expression or not and if the string does not match it returns the position at which the string first failed. |
java.lang.Object[] |
nextTokenAndDelim(java.lang.String input,
int offset)
Returns the next token and delimiter in a specified string from the specified offset. |
java.lang.String |
replace(java.lang.String input,
java.lang.String replacement)
Replaces all matching substrings in a specified string with a specified replacement string. |
java.lang.String[] |
split(java.lang.String input)
Splits the specified string into an array of tokens. |
java.lang.String |
toString()
Returns a string formatted to look like a regular expression. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RE()
public RE(java.lang.String re, boolean casesensitive) throws java.lang.Exception
RE regexp = new RE ("ab*c", true);
re
- the regular expression string.casesensitive
- the flags used to specify case-sensitivity.Method Detail |
public RegularExpression.NFA getAutomaton()
public java.lang.Object[] nextTokenAndDelim(java.lang.String input, int offset)
input
- the string to be parsed.offset
- the offset from the beginning of the input string.public boolean beginningMatches(java.lang.String input)
input
- the string to be tested.public java.lang.Object[] beginningMatchesWithLength(java.lang.String input)
input
- the string to be tested.public boolean matches(java.lang.String input)
input
- the string to be tested.public java.lang.Object[] matchesWithFailPoint(java.lang.String input)
input
- the string to be tested.public int indexOf(java.lang.String input, int offset)
input
- the input string.offset
- the offset of the input string.public java.lang.String replace(java.lang.String input, java.lang.String replacement)
input
- the string to be manipulated.replacement
- the string to replace matching portions.public java.lang.String[] split(java.lang.String input)
input
- the string to be parsed.public java.lang.String toString()
toString
in class java.lang.Object
|
RegularExpression v1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |