int RegExpr_Parse (const char *regularExpressionText, int caseSensitive, int *regularExpressionHandle);
This function parses a regular expression string.
If the string is a valid regular expression, a value is placed into the 'handle' parameter, which can then be passed to the following functions:
RegExpr_MatchText
RegExpr_Destroy
If the string is not a valid regular expression, a negative error number is returned. You can pass this error number to the RegExpr_GetErrorString function. However, in some cases there is more error information than can be encoded in the error number. You can get more detailed information about the result of the last call to this function by calling RegExpr_GetErrorElaboration.
Input | |||||||||||||||||||||||||||||||||||||||||
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
regularExpressionText | const char * | A nul–terminated string containing a regular expression. A regular expression consists of the following tokens:
|
|||||||||||||||||||||||||||||||||||||||
caseSensitive | integer | Specifies whether the matching of characters is to be done on a case–senstive or case–insensitive basis. A non–zero value specifies that characters are to be matched on a case–sensitive basis. For example. "chr" would match only to "chr" and not to "CHR". A zero value specifies that characters are to be matched on a case–insensitive basis. For example. "chr" would match to "chr", "CHR", and "Chr". This parameter does apply to ranges. For example, if this parameter is non–zero, then "[a–z]" in the regular expression string would match to any lowercase letter. If this parameter is zero, then "[a–z]" would match to any letter. |
|||||||||||||||||||||||||||||||||||||||
Output | |||||||||||||||||||||||||||||||||||||||||
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
regularExpressionHandle | integer * | A handle that represents the parse regular expression. It can be passed to the following functions: RegExpr_GetFirstCharVec RegExpr_MatchText RegExpr_Destroy When you are done with the regular expression, you should call RegExpr_Destroy on the handle. Otherwise, you will lose some memory. |
Name | Type | Description | ||||||||||||||||||||||||||||||
parseStatus | integer | Indicates if the regular expression was parsed successfully. If the string is not a valid regular expression, a negative error number is returned. You can pass this error number to the RegExpr_GetErrorString function. However, in some cases there is more error information than can be encoded in the error number. You can get more detailed information about the result of the last call to this function by calling RegExpr_GetErrorElaboration. The error numbers are:
|