Replace the first matching subexpressions with the pSearch string with the pReplace string.
Replace all occurrances if the P6MOD_GLOBAL flag is passed in the "modifiers" paramater. Place the resulting string over the string in pSearch, that is "replace in place". Note, that the 'compile' function must be called before this function. If the component was created with the trace option then the evalution steps will be detailed logged.
Meaningful modifiers: { P6MOD_INSENSITIVE, P6MOD_FASTGREEDY, P6MOD_MULTILINE, P6MOD_GLOBAL }
- Parameters
-
pSearch | [ in ] The wide string to test against the compiled regular expression. |
modifiers | [ in ] A bit mask that defines how the regex engine performs the match |
pReplace | [ in ] Wide 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. |
pSize | [ out ] Size of the string written to pSearch or if eTooSmall returned then the required buffer size. |
- Returns
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | A successful call to initialize was not made before this call. |
P6R::eInvalidArg | One or more of pSearch, pReplace, and pSize is set to NULL. |
P6R::eAccessFault | The compile function has not be successfully called. |
P6R::eNoMemory | Insufficent memory to process the regex. |
P6R::eTooSmall | pSearch too small for the resulting string, required size in pSize. |