Public Methods | |
| RE (const string &pattern) | |
| Constructor. | |
| bool | match (const string &s) |
| string | get_matched (const int i) |
| const int * | get_span (const int i) |
| int | get_nsub () |
RE wraps the regex library by Henry Spencer, which is included in the aglib package.
|
|
Constructor. Compile the given "pattern"(a regular expression) into internal form for matches which will be performed later on. |
|
|
Get i-th matched substring.
|
|
|
|
|
|
Get the start and end index of i-th substring relative to the whole string.
|
|
|
Match given string "s" with the compiled expression. "True" is returned for "match success", "false" for "match failed." The exception MatchError doesn't mean "match failed." |
![]() |