Add to git.
[c2lib.git] / doc / pmatch.3.html
1 <html>
2 <head>
3 <meta name="generator" content="groff -Thtml, see www.gnu.org">
4 <meta name="Content-Style" content="text/css">
5 <title>pmatch</title>
6 </head>
7 <body>
8
9 <h1 align=center>pmatch</h1>
10 <a href="#NAME">NAME</a><br>
11 <a href="#SYNOPSIS">SYNOPSIS</a><br>
12 <a href="#DESCRIPTION">DESCRIPTION</a><br>
13 <a href="#AUTHOR">AUTHOR</a><br>
14 <a href="#LICENSE">LICENSE</a><br>
15 <a href="#VERSION">VERSION</a><br>
16
17 <hr>
18 <!-- Creator     : groff version 1.17.2 -->
19 <!-- CreationDate: Fri May  3 14:57:30 2002 -->
20 <a name="NAME"></a>
21 <h2>NAME</h2>
22 <table width="100%" border=0 rules="none" frame="void"
23        cols="2" cellspacing="0" cellpadding="0">
24 <tr valign="top" align="left">
25 <td width="10%"></td><td width="90%">
26 pmatch, pmatchx - test if a string matches a regular expression</td></table>
27 <a name="SYNOPSIS"></a>
28 <h2>SYNOPSIS</h2>
29
30 <table width="100%" border=0 rules="none" frame="void"
31        cols="2" cellspacing="0" cellpadding="0">
32 <tr valign="top" align="left">
33 <td width="10%"></td><td width="90%">
34 <pre><b>#include &lt;pstring.h&gt;
35
36 #define pmatch(p,str,re) pmatchx ((p), (str), (re), REG_EXTENDED, 0, 0)
37 vector pmatchx (pool, const char *str, const char *re, int cflags, int eflags, int flags);
38 </b></pre></td></table>
39 <a name="DESCRIPTION"></a>
40 <h2>DESCRIPTION</h2>
41
42 <table width="100%" border=0 rules="none" frame="void"
43        cols="2" cellspacing="0" cellpadding="0">
44 <tr valign="top" align="left">
45 <td width="10%"></td><td width="90%">
46 <b>pmatch</b> is used as a quick way to test if a string
47 <b>str</b> matches a POSIX regular expression <b>re</b>. The
48 function internally caches compiled regular expressions for
49 speed. The function returns a <b>vector</b> of <b>char
50 *</b>, containing the list of substrings which match. If the
51 regular expression does not match, then <b>NULL</b> is
52 returned.</td></table>
53
54 <table width="100%" border=0 rules="none" frame="void"
55        cols="2" cellspacing="0" cellpadding="0">
56 <tr valign="top" align="left">
57 <td width="10%"></td><td width="90%">
58 <b>pmatchx</b> is the same as <b>pmatch</b> except that it
59 allows greater control with flags. <b>cflags</b> and
60 <b>eflags</b> are passed directly to <b>regcomp(3)</b> and
61 <b>regexec(3)</b> respectively. <b>flags</b> may
62 contain:</td></table>
63
64 <table width="100%" border=0 rules="none" frame="void"
65        cols="2" cellspacing="0" cellpadding="0">
66 <tr valign="top" align="left">
67 <td width="10%"></td><td width="90%">
68 <b>PMATCH_NO_CACHE</b>: Compile the regular expression
69 regardless of whether the <b>re</b> is stored in the cache,
70 and do not store the compiled regular expression back into
71 the cache. This flag is useful to save memory if you know
72 that the particular <b>re</b> will only be used very
73 infrequently, and hence storing it in the cache would just
74 be a waste of space.</td></table>
75
76 <table width="100%" border=0 rules="none" frame="void"
77        cols="2" cellspacing="0" cellpadding="0">
78 <tr valign="top" align="left">
79 <td width="10%"></td><td width="90%">
80 Note that the state of <b>cflags</b> is not stored in the
81 cache. In rare circumstances this could cause
82 problems.</td></table>
83 <a name="AUTHOR"></a>
84 <h2>AUTHOR</h2>
85
86 <table width="100%" border=0 rules="none" frame="void"
87        cols="2" cellspacing="0" cellpadding="0">
88 <tr valign="top" align="left">
89 <td width="10%"></td><td width="90%">
90 Richard Jones &lt;rich@annexia.org&gt;</td></table>
91 <a name="LICENSE"></a>
92 <h2>LICENSE</h2>
93
94 <table width="100%" border=0 rules="none" frame="void"
95        cols="2" cellspacing="0" cellpadding="0">
96 <tr valign="top" align="left">
97 <td width="10%"></td><td width="90%">
98 GNU LGPL (see http://www.gnu.org/)</td></table>
99 <a name="VERSION"></a>
100 <h2>VERSION</h2>
101
102 <table width="100%" border=0 rules="none" frame="void"
103        cols="2" cellspacing="0" cellpadding="0">
104 <tr valign="top" align="left">
105 <td width="10%"></td><td width="90%">
106 c2lib-1.2.13</td></table>
107 <hr>
108 </body>
109 </html>