1re_comp(3) Library Functions Manual re_comp(3)
2
3
4
6 re_comp, re_exec - BSD regex functions
7
9 Standard C library (libc, -lc)
10
12 #define _REGEX_RE_COMP
13 #include <sys/types.h>
14 #include <regex.h>
15
16 [[deprecated]] char *re_comp(const char *regex);
17 [[deprecated]] int re_exec(const char *string);
18
20 re_comp() is used to compile the null-terminated regular expression
21 pointed to by regex. The compiled pattern occupies a static area, the
22 pattern buffer, which is overwritten by subsequent use of re_comp().
23 If regex is NULL, no operation is performed and the pattern buffer's
24 contents are not altered.
25
26 re_exec() is used to assess whether the null-terminated string pointed
27 to by string matches the previously compiled regex.
28
30 re_comp() returns NULL on successful compilation of regex otherwise it
31 returns a pointer to an appropriate error message.
32
33 re_exec() returns 1 for a successful match, zero for failure.
34
36 For an explanation of the terms used in this section, see at‐
37 tributes(7).
38
39 ┌──────────────────────────────────────────┬───────────────┬───────────┐
40 │Interface │ Attribute │ Value │
41 ├──────────────────────────────────────────┼───────────────┼───────────┤
42 │re_comp(), re_exec() │ Thread safety │ MT-Unsafe │
43 └──────────────────────────────────────────┴───────────────┴───────────┘
44
46 None.
47
49 4.3BSD.
50
51 These functions are obsolete; the functions documented in regcomp(3)
52 should be used instead.
53
55 regcomp(3), regex(7), GNU regex manual
56
57
58
59Linux man-pages 6.05 2023-07-20 re_comp(3)