Inheritance diagram for URegex:
Public Types | |
enum | Flag { None = 0, CaseInsensitive = 2, Comments = 4, MultiLine = 8, DotAll = 32, CanonEq = 128, UWord = 256 } |
Public Member Functions | |
this (wchar[] pattern, Flag flags=Flag.None, ParseError *pe=null) | |
this (UText pattern, Flag flags=Flag.None, ParseError *pe=null) | |
~this () | |
URegex | clone () |
UString | getPattern () |
Flag | getFlags () |
void | setText (UText t) |
UText | getText () |
Groups | groups () |
void | group (UString s, uint index) |
uint | groupCount () |
uint | start (uint index=0) |
uint | end (uint index=0) |
void | reset (uint startIndex) |
bool | match (uint startIndex) |
bool | probe (uint startIndex) |
bool | next (uint startIndex=uint.max) |
uint | replaceAll (UText replace, UString result) |
uint | replaceFirst (UText replace, UString result) |
uint | split (wchar[][] fields) |
Static Public Member Functions | |
this () | |
~this () | |
Static Public Attributes | |
FunctionLoader Bind[] | targets |
Private Member Functions | |
this (Handle handle) | |
Private Attributes | |
Handle | handle |
UText | theText |
wchar[] | g0 |
wchar[] | g1 |
wchar[] | g2 |
wchar[] | g3 |
wchar[] | g4 |
wchar[] | g5 |
wchar[] | g6 |
wchar[] | g7 |
wchar[] | g8 |
wchar[] | g9 |
Static Private Attributes | |
void * | library |
See http://icu.sourceforge.net/apiref/icu4c/uregex_8h.html for full details.
Definition at line 125 of file URegex.d.
|
Definition at line 131 of file URegex.d. Referenced by getFlags(), and this(). |
|
Close the regular expression, recovering all resources (memory) it was holding |
|
|
|
Compiles the regular expression in string form into an internal representation using the specified match mode flags. The resulting regular expression handle can then be used to perform various matching operations. Definition at line 169 of file URegex.d. References Flag, and ICU::testError(). |
|
Compiles the regular expression in string form into an internal representation using the specified match mode flags. The resulting regular expression handle can then be used to perform various matching operations. Definition at line 187 of file URegex.d. References Flag. |
|
Internal constructor; used for cloning |
|
Cloning a regular expression is faster than opening a second instance from the source form of the expression, and requires less memory. Note that the current input string and the position of any matched text within it are not cloned; only the pattern itself and and the match mode flags are copied. Cloning can be particularly useful to threaded applications that perform multiple match operations in parallel. Each concurrent RE operation requires its own instance of a URegularExpression. Definition at line 235 of file URegex.d. References ICU::testError(), and URegex. |
|
Return a copy of the source form of the pattern for this regular expression Definition at line 251 of file URegex.d. References len, ICU::testError(), and UString. |
|
Get the match mode flags that were specified when compiling this regular expression Definition at line 268 of file URegex.d. References Flag, and ICU::testError(). |
|
Set the subject text string upon which the regular expression will look for matches. This function may be called any number of times, allowing the regular expression pattern to be applied to different strings. Regular expression matching operations work directly on the application's string data. No copy is made. The subject string data must not be altered after calling this function until after all regular expression operations involving this string data are completed. Zero length strings are permitted. In this case, no subsequent match operation will dereference the text string pointer. Definition at line 296 of file URegex.d. References ICU::testError(), and theText. |
|
Get the subject text that is currently associated with this regular expression object. This simply returns whatever was previously supplied via setText(). Note that this returns a read-only reference to the text. Definition at line 315 of file URegex.d. References theText. |
|
Return a set of slices representing the parenthesised groups. This can be used in the following manner:
Note that g0 represents the entire match, whereas g1 through g9 represent the parenthesised expressions. Definition at line 338 of file URegex.d. References end(), UText::get(), groupCount(), start(), and theText. |
|
Extract the string for the specified matching expression or subexpression. UString 's' is the destination for the match. Group #0 is the complete string of matched text. Group #1 is the text matched by the first set of capturing parentheses. Definition at line 361 of file URegex.d. References UString::format(). |
|
Get the number of capturing groups in this regular expression's pattern Definition at line 378 of file URegex.d. References ICU::testError(). Referenced by groups(). |
|
Returns the index in the input string of the start of the text matched by the specified capture group during the previous match operation. Return -1 if the capture group was not part of the last match. Group #0 refers to the complete range of matched text. Group #1 refers to the text matched by the first set of capturing parentheses Definition at line 400 of file URegex.d. References ICU::testError(). |
|
Returns the index in the input string of the position following the end of the text matched by the specified capture group. Return -1 if the capture group was not part of the last match. Group #0 refers to the complete range of matched text. Group #1 refers to the text matched by the first set of capturing parentheses. Definition at line 422 of file URegex.d. References ICU::testError(). |
|
Reset any saved state from the previous match. Has the effect of causing uregex_findNext to begin at the specified index, and causing uregex_start(), uregex_end() and uregex_group() to return an error indicating that there is no match information available. Definition at line 442 of file URegex.d. References ICU::testError(). |
|
Attempts to match the input string, beginning at startIndex, against the pattern. To succeed, the match must extend to the end of the input string Definition at line 460 of file URegex.d. References ICU::testError(). |
|
Attempts to match the input string, starting from the specified index, against the pattern. The match may be of any length, and is not required to extend to the end of the input string. Contrast with match() Definition at line 479 of file URegex.d. References ICU::testError(). |
|
Returns whether the text matches the search pattern, starting from the current position. If startIndex is specified, the current position is moved to the specified location before the seach is initiated. Definition at line 498 of file URegex.d. References ICU::testError(). |
|
Replaces every substring of the input that matches the pattern with the given replacement string. This is a convenience function that provides a complete find-and-replace-all operation. This method scans the input string looking for matches of the pattern. Input that is not part of any match is copied unchanged to the destination buffer. Matched regions are replaced in the output buffer by the replacement string. The replacement string may contain references to capture groups; these take the form of $1, $2, etc. The provided 'result' will contain the results, and should be set with a length sufficient to house the entire result. Upon completion, the 'result' is shortened appropriately and the total extent (length) of the operation is returned. Set the initital length of 'result' using the UString method truncate(). The returned extent should be checked to ensure it is not longer than the length of 'result'. If it is longer, then the result has been truncated. Definition at line 538 of file URegex.d. References UText::get(), len, UText::length(), ICU::testError(), and UString::truncate(). |
|
Replaces the first substring of the input that matches the pattern with the given replacement string. This is a convenience function that provides a complete find-and-replace operation. This method scans the input string looking for a match of the pattern. All input that is not part of the match is copied unchanged to the destination buffer. The matched region is replaced in the output buffer by the replacement string. The replacement string may contain references to capture groups; these take the form of $1, $2, etc The provided 'result' will contain the results, and should be set with a length sufficient to house the entire result. Upon completion, the 'result' is shortened appropriately and the total extent (length) of the operation is returned. Set the initital length of 'result' using the UString method truncate(). The returned extent should be checked to ensure it is not longer than the length of 'result'. If it is longer, then the result has been truncated. Definition at line 576 of file URegex.d. References UText::get(), len, UText::length(), ICU::testError(), and UString::truncate(). |
|
Split the text up into slices (fields), where each slice represents the text situated between each pattern matched within the text. The pattern is expected to represent one or more slice delimiters. Definition at line 595 of file URegex.d. References end(), UText::get(), start(), ICU::testError(), and theText. |
|
|
|
|
|
|
|
Bind the ICU functions from a shared library. This is complicated by the issues regarding D and DLLs on the Windows platform |
|
Initial value: [ {cast(void**) &uregex_open, "uregex_open"} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|