Developer Reference for Intel® Integrated Performance Primitives 2018

RegExpFind

Looks for the occurrences of the substrings matching the specified regular expression.

Syntax

IppStatus ippsRegExpFind_8u(const Ipp8u* pSrc, int srcLen, IppRegExpState* pRegExpState, IppRegExpFind* pFind, int* pNumFind);

Include Files

ippch.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib

Parameters

pSrc

Pointer to the source strings.

srcLen

Number of elements in the source string.

pRegExpState

Pointer to the structure containing internal form of regular expression.

pFind

Array of pointers to the matching substrings.

pNumFind

Size of the array pFind on input, number of matching substrings on output.

Description

This function search through the srcLen elements of the source string pSrc for substrings that match the specified regular expression in accordance with the regular expression pattern that is stored in the structure pRegExpState. This structure must be initialized by the ippsRegExpInit function beforehand. Initially the parameter pNumFind specifies the size of array pFind, the output parameter pNumFind returns the number of the matching substrings.

pFind->pFind specifies the offset of the pointer to the matching substring, and pFind->lenFind - number of elements in the matching substring. pFind [0] points to the substring that matches the whole regular expression, pFind [1] points to the substring that matches the first grouping, pFind[2] points to the substring that matches the second grouping, and so on.

If number of matches exceeds the size of the pFind array, the function returns ippStsOverflow status. In this case you should increase pNumFind value and repeat the search.

Note

It is recommended to set the default value of the parameter matchLimit in accordance with real necessity by calling the function ippsRegExpSetMatchLimit beforehand.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error condition if one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error condition if srcLen is negative, or pNumFind is less than or equal to 0.

ippStsRegExpErr

The state structure pRegExpState contains wrong data.

ippStsRegExpMatchLimitErr

The match limit has been exhausted.

ippStsOverflow

The size of pFind array is less than the number of matching substrings.

Example

RegExpFind.c