Debian Codegraph @

upstream/debian-trixie/man3/re_comp.3

raw
1 '\" t
2 .\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.)
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@@ee.surrey.ac.uk)
7 .\"
8 .TH re_comp 3 2024-05-02 "Linux man-pages 6.9.1"
9 .SH NAME
10 re_comp, re_exec \- BSD regex functions
11 .SH LIBRARY
12 Standard C library
13 .RI ( libc ", " \-lc )
14 .SH SYNOPSIS
15 .nf
16 .B #define _REGEX_RE_COMP
17 .B #include <sys/types.h>
18 .B #include <regex.h>
19 .P
20 .BI "[[deprecated]] char *re_comp(const char *" regex );
21 .BI "[[deprecated]] int re_exec(const char *" string );
22 .fi
23 .SH DESCRIPTION
24 .BR re_comp ()
25 is used to compile the null-terminated regular expression pointed to by
26 .IR regex .
27 The compiled pattern occupies a static area, the pattern buffer,
28 which is overwritten by subsequent use of
29 .BR re_comp ().
30 If
31 .I regex
32 is NULL,
33 no operation is performed and the pattern buffer's contents are not
34 altered.
35 .P
36 .BR re_exec ()
37 is used to assess whether the null-terminated string pointed to by
38 .I string
39 matches the previously compiled
40 .IR regex .
41 .SH RETURN VALUE
42 .BR re_comp ()
43 returns NULL on successful compilation of
44 .I regex
45 otherwise it returns a pointer to an appropriate error message.
46 .P
47 .BR re_exec ()
48 returns 1 for a successful match, zero for failure.
49 .SH ATTRIBUTES
50 For an explanation of the terms used in this section, see
51 .BR attributes (7).
52 .TS
53 allbox;
54 lbx lb lb
55 l l l.
56 Interface Attribute Value
57 T{
58 .na
59 .nh
60 .BR re_comp (),
61 .BR re_exec ()
62 T} Thread safety MT-Unsafe
63 .TE
64 .SH STANDARDS
65 None.
66 .SH HISTORY
67 4.3BSD.
68 .P
69 These functions are obsolete; the functions documented in
70 .BR regcomp (3)
71 should be used instead.
72 .SH SEE ALSO
73 .BR regcomp (3),
74 .BR regex (7),
75 GNU regex manual