Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IRegex::search ( const P6CHAR pSearch,
P6REGEXMODIFIER  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: { P6MODIFIER_INSENSITIVE, P6MODIFIER_FASTGREEDY, P6MODIFIER_MULTILINE }

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

* P6CHAR stringToSearch = "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 narrow 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. This offset represents the start of the entire match. 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, a value of zero if no match found. This length represents the length of the entire match. If you are capturing text, remember to use getCaptureText() to get the information for each capture.
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.