REGEX(3)

NAME
regex - regular expression interface

SYNOPSIS
    #include <regex.h>
    int        regcomp(regex_t* re, const char* regex, int cflags);
    int        regexec(const regex_t* re, const char* string, size_t nmatch, regmatch_t pmatch[], int eflags);
    void       regfree(regex_t* re);
    regclass_t regclass(const char* str, char** end);
    int        regcollate(const char* str, char** end, char* buf, int size);
    regstat_t* regstat(const regex_t* re);
    regex_t*   regcache(const char* pattern, regflags_t flags, int* pcode);
    int        regnexec(const regex_t* re, const char* subject, size_t size, size_t nmatch, regmatch_t* match, regflags_t flags);
    int        regrecord(const regex_t* re);
    int        regrexec(const regex_t* re, const char* buf, size_t size, size_t nmatch, regmatch_t* match, regflags_t flags, int sep, void* handle, regrecord_t recordf);

DESCRIPTION
and are the POSIX regular expression functions. The remaining functions are ast extensions. ast also provides flags extensions to the and functions.

maintains a cache of compiled regular expressions for patterns of size 255 bytes or less. The initial cache size is 8. and are passed to with an pointer maintained by if not 0, points to the return value of the call. If the call fails, returns 0 and will point to the non-zero error code. Do not call on the returned by Both and are used to match entries in the cache. When the cache is full the least recently used is freed (via to make space for the new pattern. Any previously returned by may be freed (invalidated) on the next call to If is longer that 255 bytes then it is still passed on to but it will not be cached. If is 0 then the cache is flushed. In addition, if the integer value of is greater than the current cache size, the cache size is increased to that integer value. 0 is always returned when is 0; will point to a non-zero value on error.

SEE ALSO
strmatch(3)