1RE_COMP(3) Linux Programmer's Manual RE_COMP(3)
2
3
4
6 re_comp, re_exec - BSD regex functions
7
9 #define _REGEX_RE_COMP
10 #include <sys/types.h>
11 #include <regex.h>
12
13 char *re_comp(const char *regex);
14 int re_exec(const char *string);
15
17 re_comp() is used to compile the null-terminated regular expression
18 pointed to by regex. The compiled pattern occupies a static area, the
19 pattern buffer, which is overwritten by subsequent use of re_comp().
20 If regex is NULL, no operation is performed and the pattern buffer's
21 contents are not altered.
22
23 re_exec() is used to assess whether the null-terminated string pointed
24 to by string matches the previously compiled regex.
25
27 re_comp() returns NULL on successful compilation of regex otherwise it
28 returns a pointer to an appropriate error message.
29
30 re_exec() returns 1 for a successful match, zero for failure.
31
33 For an explanation of the terms used in this section, see at‐
34 tributes(7).
35
36 ┌──────────────────────────────────────────┬───────────────┬───────────┐
37 │Interface │ Attribute │ Value │
38 ├──────────────────────────────────────────┼───────────────┼───────────┤
39 │re_comp(), re_exec() │ Thread safety │ MT-Unsafe │
40 └──────────────────────────────────────────┴───────────────┴───────────┘
41
43 4.3BSD.
44
46 These functions are obsolete; the functions documented in regcomp(3)
47 should be used instead.
48
50 regcomp(3), regex(7), GNU regex manual
51
53 This page is part of release 5.12 of the Linux man-pages project. A
54 description of the project, information about reporting bugs, and the
55 latest version of this page, can be found at
56 https://www.kernel.org/doc/man-pages/.
57
58
59
60GNU 2021-03-22 RE_COMP(3)