]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/re_comp.3
man*/: ffix (un-bracket tables)
[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 .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 .sp 1
65 .SH STANDARDS
66 None.
67 .SH HISTORY
68 4.3BSD.
69 .PP
70 These functions are obsolete; the functions documented in
71 .BR regcomp (3)
72 should be used instead.
73 .SH SEE ALSO
74 .BR regcomp (3),
75 .BR regex (7),
76 GNU regex manual