OSDN Git Service

2fe6bfc11690a8febc482f389974d0fc43173bc0
[linuxjm/LDP_man-pages.git] / original / man3 / re_comp.3
1 .\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@@ee.surrey.ac.uk)
26 .\"
27 .TH RE_COMP 3 2013-06-21 "GNU" "Linux Programmer's Manual"
28 .SH NAME
29 re_comp, re_exec \- BSD regex functions
30 .SH SYNOPSIS
31 .B #define _REGEX_RE_COMP
32 .br
33 .B #include <sys/types.h>
34 .br
35 .B #include <regex.h>
36 .sp
37 .BI "char *re_comp(char *" regex );
38 .sp
39 .BI "int re_exec(char *" string );
40 .SH DESCRIPTION
41 .BR re_comp ()
42 is used to compile the null-terminated regular expression pointed to by
43 .IR regex .
44 The compiled pattern occupies a static area, the pattern buffer,
45 which is overwritten by subsequent use of
46 .BR re_comp ().
47 If
48 .I regex
49 is NULL,
50 no operation is performed and the pattern buffer's contents are not
51 altered.
52
53 .BR re_exec ()
54 is used to assess whether the null-terminated string pointed to by
55 .I string
56 matches the previously compiled
57 .IR regex .
58 .SH RETURN VALUE
59 .BR re_comp ()
60 returns NULL on successful compilation of
61 .I regex
62 otherwise it returns a pointer to an appropriate error message.
63
64 .BR re_exec ()
65 returns 1 for a successful match, zero for failure.
66 .SH ATTRIBUTES
67 .SS Multithreading (see pthreads(7))
68 The
69 .BR re_comp ()
70 and
71 .BR re_exec ()
72 functions are not thread-safe.
73 .SH CONFORMING TO
74 4.3BSD.
75 .SH NOTES
76 These functions are obsolete; the functions documented in
77 .BR regcomp (3)
78 should be used instead.
79 .SH SEE ALSO
80 .BR regcomp (3),
81 .BR regex (7),
82 GNU regex manual
83 .SH COLOPHON
84 This page is part of release 3.64 of the Linux
85 .I man-pages
86 project.
87 A description of the project,
88 and information about reporting bugs,
89 can be found at
90 \%http://www.kernel.org/doc/man\-pages/.