3 .ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
4 .if !
\a\\$4
\a\a .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
7 .ie
\a\\$3
\a\a .ft \\$1
11 .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
16 .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
19 .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
22 .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
24 .de EX \" start example
41 regex \- regular expression interface
46 int regcomp(regex_t* \fIre\fP, const char* \fIregex\fP, int \fIcflags\fP);
47 int regexec(const regex_t* \fIre\fP, const char* \fIstring\fP, size_t \fInmatch\fP, regmatch_t \fIpmatch\fP[], int \fIeflags\fP);
48 size_t regerror(int \fIcode\fP, const regex_t* \fIre\fP, char* \fIerrbuf\fP, size_t \fIerrbuf_size\fP);
49 void regfree(regex_t* \fIre\fP);
51 regclass_t regclass(const char* \fIstr\fP, char** \fIend\fP);
52 int regaddclass(const char* \fIname\fP, regclass_t \fIclassf\fP);
53 int regcollate(const char* \fIstr\fP, char** \fIend\fP, char* \fIbuf\fP, int \fIsize\fP);
55 int regcomb(regex_t* \fIre_1\fP, regex_t* \fIre_2\fP);
56 size_t regdecomp(regex_t* \fIre\fP, regflags_t \fIflags\fP, char* \fIbuf\fP, size_t \fIsize\fP);
57 int regdup(regex_t* \fIre_old\fP, regex_t* \fIre_new\fP);
58 regstat_t* regstat(const regex_t* \fIre\fP);
60 regex_t* regcache(const char* \fIpattern\fP, regflags_t \fIflags\fP, int* \fIpcode\fP);
62 int regncomp(regex_t* \fIre\fP, const char* \fIpattern\fP, size_t \fIsize\fP, regflags_t \fIflags\fP);
63 int regnexec(const regex_t* \fIre\fP, const char* \fIsubject\fP, size_t \fIsize\fP, size_t \fInmatch\fP, regmatch_t* \fImatch\fP, regflags_t \fIflags\fP);
64 int regrecord(const regex_t* \fIre\fP);
65 int regrexec(const regex_t* \fIre\fP, const char* \fIbuf\fP, size_t \fIsize\fP, size_t \fInmatch\fP, regmatch_t* \fImatch\fP, regflags_t \fIflags\fP, int \fIsep\fP, void* \fIhandle\fP, regrecord_t \fIrecordf\fP);
66 void regfatal(regex_t* \fIre\fP, int \fIlevel\fP, int \fIcode\fP);
67 void regfatalpat(regex_t* \fIre\fP, int \fIlevel\fP, int \fIcode\fP, const char* \fIpattern\fP);
69 int regsubcomp(regex_t* \fIre\fP, const char* \fIstr\fP, const regflags_t* \fImap\fP, int \fIminmatch\fP, regflags_t \fIflags\fP);
70 int regsubexec(const regex_t* \fIre\fP, const char* \fIsubject\fP, size_t \fInmatch\fP, regmatch_t* match);
71 int regsubflags(regex_t* \fIre\fP, const char* \fIstr\fP, char** \fIend\fP, int \fIdelim\fP, const regflags_t* \fImap\fP, int* \fIpm\fP, regflags_t* \fIpf\fP);
72 void regsubfree(regex_t* \fIre\fP);
81 are the POSIX regular expression functions.
82 The remaining functions are
99 maintains a cache of compiled regular expressions for patterns of size
101 The initial cache size is 8.
109 pointer maintained by
112 if not 0, points to the return value of the
121 will point to the non-zero error code.
132 are used to match entries in the cache.
133 When the cache is full the least recently used
137 to make space for the new pattern.
140 previously returned by
142 may be freed (invalidated) on the next call to
146 is longer that 255 bytes then it is still passed on to
148 but it will not be cached.
151 is 0 then the cache is flushed.
152 In addition, if the integer value of
154 is greater than the current cache size, the cache size is increased
155 to that integer value.
156 0 is always returned when
160 will point to a non-zero value on error.