iDRS™ SDK 16
Loading...
Searching...
No Matches
CRegexSearchContext_interface.h File Reference

Interface for CRegexSearchContext wrapper. More...

Go to the source code of this file.

Functions

CRegexSearchContext CRegexSearchContext_Create (idrs_exception *pargException)
 Creates a new instance of CRegexSearchContext.
 
CRegexSearchContext CRegexSearchContext_Create2 (const idrs_string strPattern, idrs_exception *pargException)
 Creates a new instance of CRegexSearchContext with a pattern.
 
const idrs_string CRegexSearchContext_GetPattern (const CRegexSearchContext argCRegexSearchContext, idrs_exception *pargException)
 Gets the regular expression pattern.
 
void CRegexSearchContext_SetPattern (CRegexSearchContext argCRegexSearchContext, const idrs_string strPattern, idrs_exception *pargException)
 Sets the regular expression pattern.
 
void CRegexSearchContext_Destroy (CRegexSearchContext argCRegexSearchContext, idrs_exception *pargException)
 Destroys a CRegexSearchContext handle.
 

Detailed Description

Interface for CRegexSearchContext wrapper.

Function Documentation

◆ CRegexSearchContext_Create()

CRegexSearchContext CRegexSearchContext_Create ( idrs_exception *  pargException)

Creates a new instance of CRegexSearchContext.

Returns
The new instance of CRegexSearchContext.
Parameters
pargExceptionPointer to exception structure that will be filled if an exception occurs
Remarks
Instances created by this method can also be provided to CSearchContext methods

◆ CRegexSearchContext_Create2()

CRegexSearchContext CRegexSearchContext_Create2 ( const idrs_string  strPattern,
idrs_exception *  pargException 
)

Creates a new instance of CRegexSearchContext with a pattern.

Parameters
strPatternThe expression pattern to be matched (either a string or a regular expression).
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The new instance of CRegexSearchContext.
Remarks
Instances created by this method can also be provided to CSearchContext methods

◆ CRegexSearchContext_Destroy()

void CRegexSearchContext_Destroy ( CRegexSearchContext  argCRegexSearchContext,
idrs_exception *  pargException 
)

Destroys a CRegexSearchContext handle.

Parameters
argCRegexSearchContextCRegexSearchContext handle to destroy
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CRegexSearchContext_GetPattern()

const idrs_string CRegexSearchContext_GetPattern ( const CRegexSearchContext  argCRegexSearchContext,
idrs_exception *  pargException 
)

Gets the regular expression pattern.

Returns
The regular expression pattern
Parameters
argCRegexSearchContextCRegexSearchContext handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CRegexSearchContext_SetPattern()

void CRegexSearchContext_SetPattern ( CRegexSearchContext  argCRegexSearchContext,
const idrs_string  strPattern,
idrs_exception *  pargException 
)

Sets the regular expression pattern.

Parameters
argCRegexSearchContextCRegexSearchContext handle
strPatternThe regular expression pattern
pargExceptionPointer to exception structure that will be filled if an exception occurs The pattern follows the .NET regular expressions syntax (from 2021) without the backreference constructs. (https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference) As a quick hand here are the basics
^ $ : stand for begin and end of line respectively
( ) : defines a group,
[ ] : defines a set of accepted characters
[^ ] : defines a set of refused characters
\ : is used to escape a special character or set create a control character ( \n \r \t \f ...)
? + * : respectively, 0 or 1 , at least 1 , any , of the preceding character/set/group
| : the regex will match if either the left part or the right part of the vertical bar match. If in a group, it will apply to the group only and not the whole expression
{ } : defines a function to be used, not a range of repetion for the previous character/set/group. Please refer to the link provided