]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/re_comp.3
0ec5e1e0443ff9b63bbb4626e412ba346ae1fe96
[thirdparty/man-pages.git] / man3 / re_comp.3
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 (date) "Linux man-pages (unreleased)"
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 .PP
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 .PP
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 .PP
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 .ad l
53 .nh
54 .TS
55 allbox;
56 lbx lb lb
57 l l l.
58 Interface Attribute Value
59 T{
60 .BR re_comp (),
61 .BR re_exec ()
62 T} Thread safety MT-Unsafe
63 .TE
64 .hy
65 .ad
66 .sp 1
67 .SH STANDARDS
68 None.
69 .SH HISTORY
70 4.3BSD.
71 .PP
72 These functions are obsolete; the functions documented in
73 .BR regcomp (3)
74 should be used instead.
75 .SH SEE ALSO
76 .BR regcomp (3),
77 .BR regex (7),
78 GNU regex manual