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