Regular Expressions


  int  regex_match(char *regexp, char *text);


The regex_match function performs a regular expression match on the given expression regexp and text. It returns non-zero (true) if there is a match, or zero (false) if there is no match. Both strings are assumed to be UTF-8 strings.

The regular expression language is very simple:

The only special characters are '*' and '?'. There is currently no way to escape these characters. The '.', '^', '$', and '\' characters all have no special meaning. Strings must match at the start and end of the string unless the '*' character is used at the start or end. This scheme is similar to a shell match, rather than grep.