Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IWRegex::search ( const P6WCHAR pSearch,
P6WREGEXMODIFIER  modifiers,
P6UINT32 pOffset,
P6UINT32 pLength 
)
pure virtual

Does the compiled regular expression match a substring in the pSearch input string.

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 }

In order to perform a global search (i.e., over the entire string pointed to by pSearch) call this function repeatedly as follows:

* P6WCHAR stringToSearch = P6TEXT("look in this string");
* P6UINT32 i = 0;
* P6UINT32 offset = 0;
* P6UINT32 length = 0;
* do {
* offset = 0;
* length = 0;
* err = search( &stringToSearch[i], P6MOD_NULL, &offset, &length );
* i = offset + length;
* // -> &stringToSearch[offset] is the start of the match for length characters
* }
* while( 0 != length );
*
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
pOffset[ out ] Index into pSearch buffer pointing to where the regex match starts. If you are capturing text, remember to use getCaptureText() to get the information for each capture.
pLength[ out ] Length of the matching substring in pSearch, value is equal to zero if no match found.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to initialize was not made before this call.
P6R::eInvalidArgpSearch, pOffset, or pLength is NULL.
P6R::eAccessFaultThe compile function has not be successfully called.
P6R::eNoMemoryInsufficent memory to process the regex.