-
Notifications
You must be signed in to change notification settings - Fork 0
/
fnmatch.3.html
150 lines (148 loc) · 6.67 KB
/
fnmatch.3.html
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file. Do not edit.
t
Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
SPDX-License-Identifier: Linux-man-pages-copyleft
Modified Sat Jul 24 19:35:54 1993 by Rik Faith (faith@cs.unc.edu)
Modified Mon Oct 16 00:16:29 2000 following Joseph S. Myers
-->
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>fnmatch(3)</title>
</head>
<body>
<table class="head">
<tr>
<td class="head-ltitle">fnmatch(3)</td>
<td class="head-vol">Library Functions Manual</td>
<td class="head-rtitle">fnmatch(3)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp">fnmatch - match filename or pathname</p>
</section>
<section class="Sh">
<h1 class="Sh" id="LIBRARY"><a class="permalink" href="#LIBRARY">LIBRARY</a></h1>
<p class="Pp">Standard C library (<i>libc</i>, <i>-lc</i>)</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<pre><b>#include <fnmatch.h></b></pre>
<pre><b>int fnmatch(const char *</b><i>pattern</i><b>, const char *</b><i>string</i><b>, int </b><i>flags</i><b>);</b></pre>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <b>fnmatch</b>() function checks whether the <i>string</i>
argument matches the <i>pattern</i> argument, which is a shell wildcard
pattern (see <b>glob</b>(7)).</p>
<p class="Pp">The <i>flags</i> argument modifies the behavior; it is the bitwise
OR of zero or more of the following flags:</p>
<dl class="Bl-tag">
<dt id="FNM_NOESCAPE"><a class="permalink" href="#FNM_NOESCAPE"><b>FNM_NOESCAPE</b></a></dt>
<dd>If this flag is set, treat backslash as an ordinary character, instead of
an escape character.</dd>
<dt id="FNM_PATHNAME"><a class="permalink" href="#FNM_PATHNAME"><b>FNM_PATHNAME</b></a></dt>
<dd>If this flag is set, match a slash in <i>string</i> only with a slash in
<i>pattern</i> and not by an asterisk (*) or a question mark (?)
metacharacter, nor by a bracket expression ([]) containing a slash.</dd>
<dt id="FNM_PERIOD"><a class="permalink" href="#FNM_PERIOD"><b>FNM_PERIOD</b></a></dt>
<dd>If this flag is set, a leading period in <i>string</i> has to be matched
exactly by a period in <i>pattern</i>. A period is considered to be
leading if it is the first character in <i>string</i>, or if both
<b>FNM_PATHNAME</b> is set and the period immediately follows a
slash.</dd>
<dt id="FNM_FILE_NAME"><a class="permalink" href="#FNM_FILE_NAME"><b>FNM_FILE_NAME</b></a></dt>
<dd>This is a GNU synonym for <b>FNM_PATHNAME</b>.</dd>
<dt id="FNM_LEADING_DIR"><a class="permalink" href="#FNM_LEADING_DIR"><b>FNM_LEADING_DIR</b></a></dt>
<dd>If this flag (a GNU extension) is set, the pattern is considered to be
matched if it matches an initial segment of <i>string</i> which is
followed by a slash. This flag is mainly for the internal use of glibc and
is implemented only in certain cases.</dd>
<dt id="FNM_CASEFOLD"><a class="permalink" href="#FNM_CASEFOLD"><b>FNM_CASEFOLD</b></a></dt>
<dd>If this flag (a GNU extension) is set, the pattern is matched
case-insensitively.</dd>
<dt id="FNM_EXTMATCH"><a class="permalink" href="#FNM_EXTMATCH"><b>FNM_EXTMATCH</b></a></dt>
<dd>If this flag (a GNU extension) is set, extended patterns are supported, as
introduced by 'ksh' and now supported by other shells. The extended format
is as follows, with <i>pattern-list</i> being a '|' separated list of
patterns.</dd>
<dt>'?(<i>pattern-list</i>)'</dt>
<dd>The pattern matches if zero or one occurrences of any of the patterns in
the <i>pattern-list</i> match the input <i>string</i>.</dd>
<dt>'*(<i>pattern-list</i>)'</dt>
<dd>The pattern matches if zero or more occurrences of any of the patterns in
the <i>pattern-list</i> match the input <i>string</i>.</dd>
<dt>'+(<i>pattern-list</i>)'</dt>
<dd>The pattern matches if one or more occurrences of any of the patterns in
the <i>pattern-list</i> match the input <i>string</i>.</dd>
<dt>'@(<i>pattern-list</i>)'</dt>
<dd>The pattern matches if exactly one occurrence of any of the patterns in
the <i>pattern-list</i> match the input <i>string</i>.</dd>
<dt>'!(<i>pattern-list</i>)'</dt>
<dd>The pattern matches if the input <i>string</i> cannot be matched with any
of the patterns in the <i>pattern-list</i>.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="RETURN_VALUE"><a class="permalink" href="#RETURN_VALUE">RETURN
VALUE</a></h1>
<p class="Pp">Zero if <i>string</i> matches <i>pattern</i>, <b>FNM_NOMATCH</b>
if there is no match or another nonzero value if there is an error.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="ATTRIBUTES"><a class="permalink" href="#ATTRIBUTES">ATTRIBUTES</a></h1>
<p class="Pp">For an explanation of the terms used in this section, see
<b>attributes</b>(7).</p>
<table class="tbl" border="1" style="border-style: solid;">
<tr>
<td><b>Interface</b></td>
<td><b>Attribute</b></td>
<td><b>Value</b></td>
</tr>
<tr>
<td>fnmatch ()</td>
<td>Thread safety</td>
<td>MT-Safe env locale</td>
</tr>
</table>
</section>
<section class="Sh">
<h1 class="Sh" id="STANDARDS"><a class="permalink" href="#STANDARDS">STANDARDS</a></h1>
<dl class="Bl-tag">
<dt id="fnmatch"><a class="permalink" href="#fnmatch"><b>fnmatch</b>()</a></dt>
<dd>POSIX.1-2008.</dd>
<dt id="FNM_FILE_NAME~2"><a class="permalink" href="#FNM_FILE_NAME~2"><b>FNM_FILE_NAME</b></a></dt>
<dd></dd>
<dt id="FNM_LEADING_DIR~2"><a class="permalink" href="#FNM_LEADING_DIR~2"><b>FNM_LEADING_DIR</b></a></dt>
<dd></dd>
<dt id="FNM_CASEFOLD~2"><a class="permalink" href="#FNM_CASEFOLD~2"><b>FNM_CASEFOLD</b></a></dt>
<dd>GNU.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<dl class="Bl-tag">
<dt id="fnmatch~2"><a class="permalink" href="#fnmatch~2"><b>fnmatch</b>()</a></dt>
<dd>POSIX.1-2001, POSIX.2.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><b>sh</b>(1), <b>glob</b>(3), <b>scandir</b>(3),
<b>wordexp</b>(3), <b>glob</b>(7)</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">2024-05-02</td>
<td class="foot-os">Linux man-pages 6.9.1</td>
</tr>
</table>
</body>
</html>