Note: we have customer complaints that our regex functions are sometimes slower than running `grep` directly.  It may be a good idea to avoid PCRE calls to compile a regex if there are no metacharacters, at least.  We should also cache PCRE compilations because these internal functions are getting called many times during an agent run.