Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IRegex::replace ( const P6CHAR pSearch,
P6REGEXMODIFIER  modifiers,
const P6CHAR pReplace,
P6CHAR pResult,
P6UINT32  cBuffer,
P6UINT32 pWritten 
)
pure virtual

Replaces the first matching subexpressions in the pSearch string with the pReplace string.

Replaces all occurrances if the MODIFIER_GLOBAL flag is passed in the "modifiers" paramater. Place the resulting string in the pResult buffer passed in by the caller and does not modify the pSearch string. Note that the compile() method must be called before this method. If the component was created with the trace option then the evalution steps will be detailed logged.

Meaningful modifiers: { P6MODIFIER_INSENSITIVE, P6MODIFIER_FASTGREEDY, P6MODIFIER_MULTILINE, P6MODIFIER_GLOBAL }

Parameters
pSearch[ in ] The narrow string to test against the compiled regular expression.
modifiers[ in ] A bit mask that defines how the regex engine performs the match
pReplace[ in ] String to replace the matched subexpression with. This string can have back references in it (e.g., "--\1--\2"). The back references are evaluated after each match for global matches.
pResult[ out ] Can be NULL. Buffer to write the newly constructed string into. When NULL pWritten returns the size of buffer required for replace to work properly.
cBuffer[ in ] Number of characters in the buffer pointed to by pResult.
pWritten[ out ] Optional can be NULL, returns the number of characters written into pResult. This parameter cannot be NULL when pResult is also NULL.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to initialize was not made before this call.
P6R::eInvalidArgpSearch or pReplace is set to NULL. If pResult and pWritten are NULL.
P6R::eAccessFaultThe compile function has not be successfully called.
P6R::eNoMemoryInsufficent memory to process the regex.
P6R::eTooSmallpResult too small for the resulting string, required size in pSize.