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
15 int re_exec(const char *string);
16
18 re_comp() is used to compile the null-terminated regular expression
19 pointed to by regex. The compiled pattern occupies a static area, the
20 pattern buffer, which is overwritten by subsequent use of re_comp().
21 If regex is NULL, no operation is performed and the pattern buffer's
22 contents are not altered.
23
24 re_exec() is used to assess whether the null-terminated string pointed
25 to by string matches the previously compiled regex.
26
28 re_comp() returns NULL on successful compilation of regex otherwise it
29 returns a pointer to an appropriate error message.
30
31 re_exec() returns 1 for a successful match, zero for failure.
32
34 For an explanation of the terms used in this section, see
35 attributes(7).
36
37 ┌─────────────────────┬───────────────┬───────────┐
38 │Interface │ Attribute │ Value │
39 ├─────────────────────┼───────────────┼───────────┤
40 │re_comp(), re_exec() │ Thread safety │ MT-Unsafe │
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.07 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 2017-09-15 RE_COMP(3)