Description | Uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables |
RE [ IEEE Std 1003.1 ] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html
Version 2.5.2011.12 First release
Version 2.5.2012.01 - some fixes of * handling
Name | Description |
---|---|
Class unaRegExp |
RegExp utility class. |
function parse(const regexp: wString; var ea: pointer): int; overload; |
procedure disposeEA(var ea: pointer); |
function rematch(const subject, regexp: wString; out matchlen: int; startFrom: int = 1): int; overload; |
function rematch(startFrom: int; const subject, regexp: wString): string; overload; |
function rematch(ea: pointer; const subject: wString; out matchlen: int; startFrom: int = 1): int; overload; |
function replace(const subject, regexp, substitution: wString; startFrom: int = 1; global: bool = false): wString; overload; |
function replace(ea: pointer; const subject, substitution: wString; startFrom: int = 1; global: bool = false): wString; overload; |
RE_DUP_MAX = maxInt; |
unaRE_error_backref = -13; |
unaRE_error_emptySeq = -15; |
unaRE_error_escape = -12; |
unaRE_error_escape2 = -14; |
unaRE_error_mm = -10; |
unaRE_error_mmOrder = -11; |
unaRE_error_noMatch = -1; |
unaRE_error_OK = 0; |
unaRE_error_sroot = -4; |
unaRE_error_srootExp = -5; |
function parse(const regexp: wString; var ea: pointer): int; overload; |
Parses regexp. Don't forget to dispose the result with disposeEA()
Parameters
ReturnsunaRE_error_OK, or one of unaRE_error_XXX error codes |
procedure disposeEA(var ea: pointer); |
Releases memory taken by parsed expression |
function rematch(const subject, regexp: wString; out matchlen: int; startFrom: int = 1): int; overload; |
Looks for first match from specified position.
Parameters
Returnsposition of new match, or one of unaRE_error_XXX error codes |
function rematch(startFrom: int; const subject, regexp: wString): string; overload; |
Looks for first match from specified position.
Parameters
Returnsfirst match, or empty string |
function rematch(ea: pointer; const subject: wString; out matchlen: int; startFrom: int = 1): int; overload; |
Looks for first match from specified position.
Parameters
Returnsposition of new match, or one of unaRE_error_XXX error codes |
function replace(const subject, regexp, substitution: wString; startFrom: int = 1; global: bool = false): wString; overload; |
Replaces first or all matches with substitution, which can include backrefs.
Parameters
Returnsresulting string |
function replace(ea: pointer; const subject, substitution: wString; startFrom: int = 1; global: bool = false): wString; overload; |
Replaces first or all matches with substitution, which can include backrefs.
Parameters
Returnsresulting string |
RE_DUP_MAX = maxInt; |
unaRE_error_backref = -13; |
unknown escape |
unaRE_error_emptySeq = -15; |
out of escape chars |
unaRE_error_escape = -12; |
min/max out of order in {} |
unaRE_error_escape2 = -14; |
wrong backref |
unaRE_error_mm = -10; |
root must be a subexpression (should not happen, consider as internal error) |
unaRE_error_mmOrder = -11; |
general error in {} |
unaRE_error_noMatch = -1; |
no error |
unaRE_error_OK = 0; |
max count of elements for * exp |
unaRE_error_sroot = -4; |
no match found |
unaRE_error_srootExp = -5; |
rare error in sroot (should not happen, consider as internal error) |
(c) 2012 Lake of Soft