| Flag | Value | Description |
| RegExpTypeANSI | 0x00000000 | Treat the given range as a stream of single-byte characters. May not be used with RegExpTypeUNICODE flag. |
| RegExpTypeUNICODE | 0x00000001 | Treat the given range as a stream of 16-bit unicode characters. May not be used with RegExpTypeANSI |
| RegExpIgnoreCase | 0x00000002 | True to ignore case and false to match case. |
Searches for an occurrence of a regular expression within a given range. To continue searching, call this method again, adjusting StartFrom field appropriately. If a pattern is not found in the specified range, this method returns an error. Complexity: depends on the range's size and regular expression complexity.
If regular expression syntax is invalid, the method returns (or throws) an error E_INVALIDARG. A IFileDocument.RegExpSyntaxError property contains the description of the syntax error.
When match is not found, the method returns (or throws) a NOT_FOUND error.