Grammatica
|
A regular expression string matcher. More...
Public Member Functions | |
bool | IsCaseInsensitive () |
Checks if this matcher compares in case-insensitive mode. More... | |
void | Reset () |
Resets the information about the last match. More... | |
void | Reset (string str) |
Resets the matcher for use with a new input string. More... | |
void | Reset (ReaderBuffer buffer) |
Resets the matcher for use with a new look-ahead character input stream. More... | |
int | Start () |
Returns the start position of the latest match. More... | |
int | End () |
Returns the end position of the latest match. More... | |
int | Length () |
Returns the length of the latest match. More... | |
bool | HasReadEndOfString () |
Checks if the end of the string was encountered during the last match attempt. More... | |
bool | MatchFromBeginning () |
Attempts to find a match starting at the beginning of the string. More... | |
bool | MatchFrom (int pos) |
Attempts to find a match starting at the specified position in the string. More... | |
override string | ToString () |
Returns the latest matched string. More... | |
A regular expression string matcher.
This class handles the matching of a specific string with a specific regular expression. It contains state information about the matching process, as for example the position of the latest match, and a number of flags that were set. This class is not thread-safe.
|
inline |
Returns the end position of the latest match.
This is one character after the match end, i.e. the first character after the match. If no match has been encountered, this method returns the same value as start().
|
inline |
Checks if the end of the string was encountered during the last match attempt.
This flag signals that more input may be needed in order to get a match (or a longer match).
|
inline |
Checks if this matcher compares in case-insensitive mode.
|
inline |
Returns the length of the latest match.
|
inline |
Attempts to find a match starting at the specified position in the string.
pos | the starting position of the match |
IOException | if an I/O error occurred while reading an input stream |
|
inline |
Attempts to find a match starting at the beginning of the string.
IOException | if an I/O error occurred while reading an input stream |
|
inline |
Resets the information about the last match.
This will clear all flags and set the match length to a negative value. This method is automatically called before starting a new match.
|
inline |
Resets the matcher for use with a new input string.
This will clear all flags and set the match length to a negative value.
str | the new string to work with |
|
inline |
Resets the matcher for use with a new look-ahead character input stream.
This will clear all flags and set the match length to a negative value.
buffer | the character input buffer |
|
inline |
Returns the start position of the latest match.
If no match has been encountered, this method returns zero (0).
|
inline |
Returns the latest matched string.
If no string has been matched, an empty string will be returned.