Search for string in text buffer, returning the extent of the string in beg and end. The search starts from the given starting position, scans forward (SEARCH_FORWARD) or backward (SEARCH_BACKWARD), and wraps around if SEARCH_WRAP has been specified. The search type is either a plain search (SEARCH_EXACT), case insensitive search (SEARCH_IGNORECASE), or regular expression search (SEARCH_REGEX). For regular expression searches, capturing parentheses are used if npar is greater than 1; in this case, the number of entries in the beg[], end[] arrays must be npar also. If either beg or end or both are NULL, internal arrays are used. [This API is still subject to change!!]