## Regular Expressions

### FUNCTIONS

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

### NOTES

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:

- "abc" matches the exact string "abc"
- "a*bc" matches "a" followed by zero or more chars, then "bc"
- "abc*" matches any string which starts with "abc"
- "*abc" matches any string which ends with "abc"
- "*abc*" matches any string which contains "abc"
- "a?bc" matches "a" followed by any one UTF-8 char, then "bc"
- "*.jpg" matches any string which ends in ".jpg"

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`.