Add regular expression matching support, based on OpenBSD regexec()/regcomp()