histmatch - string matching on speech file histories


int     histmatch(exp,targ,ret0,ret1,...)
char    *exp;             /* match expression */
char    *targ;            /* target string */
char    *ret0,*ret1,...   /* returned sub-strings */


histmatch is a function to perform string matching on speech file histories as stored in item headers and processed using the label routines. It returns a code expressing a match between a match expression exp, and a target string (item history) targ. The code is "1" for success, "0" for failure, and "-1" for an error on the string expression.

The following string match characters are currently supported in exp:

"?" Match any single character (except line start and line end).

"*" Match zero or more characters (including line start and line end).

"%" digit, "%%" Match a string of characters up to ";", ",", ")" and line end, and return the string in a function argument given after the target string. Thus "%0" will return a substring into variable ret0, etc, "%%" performs matching without returning a string. Matched substrings are further constrained to include equal numbers of open and close parentheses.

any Any other characters must match exactly. Escape special characters with "\".

The parameter "exp" may contain a single match expression or a sequence of expressions separated by "\033" (ESCAPE) characters. histmatch returns at the first matching expression.


1.0 - Mark Huckvale.




"exp" must match whole string.
Fri Jul 09 14:54:17 2004