rexMatch |
|
rexMatch( // compile regular expression const handle, // rex handle const string, // string to match const nmatch, // # of matches to find var &match[][], // index & length of every match [const flags]); // match flags Compares the string against the compiled regular expression represented by handle to find a match between the two. nmatch is the number of substrings in string that rexMatch should try to match with subexpressions in handle. The array you supply for match must have at least nmatch by 2 elements. rexMatch fills in the elements of the array match with the starting index and the length of the matched substrings. The zeroth element of the array corresponds to the entire pattern. If there are more than nmatch subexpressions, only the first nmatch - 1 are stored. If nmatch is 0, or if the rexOpenNosubreps flag was set when handle was created with rexOpen, rexMatch ignores the match argument and only returns 0 or 1 indicating if a match was found. flags defines customizable behavior of rexMatch:
When a basic or extended regular expression is matched, any given parenthesized subexpression of the original pattern could participate in the match of several different substrings of string. The following rules determine which substrings are reported in pmatch:
If the rexOpenNosubreps flag was set when handle was created byrexOpen, the contents of match are unspecified. If therexOpenNewline flag was not set when handle was created, new-line characters will not be treated as end-of-line. Return valueIf a match is found, rexMatch returns the number of matches including subreports. If no match is found rexMatch returns O. | ||||||||||
Copyright © IBK Landquart | Last revised by Peter Koch, 24.02.00 | << Back Top Next >> |