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