reference/filesystem/functions/fnmatch.xml
39a98b1f1776afd4c41f79ce528309c95f62b10a
...
...
@@ -28,7 +28,75 @@
28
28
<term><parameter>pattern</parameter></term>
29
29
<listitem>
30
30
<para>
31
-
The shell wildcard pattern.
31
+
The <parameter>pattern</parameter> to match against. Usually, the <parameter>pattern</parameter> will contain
32
+
wildcards like <literal>'?'</literal> and <literal>'*'</literal>.
33
+
<table>
34
+
<title>
35
+
Wildcards to be used in <parameter>pattern</parameter> parameter
36
+
</title>
37
+
<tgroup cols="2">
38
+
<thead>
39
+
<row>
40
+
<entry>Wildcard</entry>
41
+
<entry>&Description;</entry>
42
+
</row>
43
+
</thead>
44
+
<tbody>
45
+
<row>
46
+
<entry>
47
+
<literal>?</literal>
48
+
</entry>
49
+
<entry>
50
+
Question mark will match any single character.
51
+
For example, pattern <literal>"file?.txt"</literal> will match <literal>"file1.txt"</literal> and
52
+
<literal>"fileA.txt"</literal>, but will not match <literal>"file10.txt"</literal>.
53
+
</entry>
54
+
</row>
55
+
<row>
56
+
<entry>
57
+
<literal>*</literal>
58
+
</entry>
59
+
<entry>
60
+
Asterisk will match zero or more characters.
61
+
For example, pattern <literal>"foo*.xml"</literal> will match <literal>"foo.xml"</literal> and
62
+
<literal>"foobar.xml"</literal>.
63
+
</entry>
64
+
</row>
65
+
<row>
66
+
<entry>
67
+
<literal>[ ]</literal>
68
+
</entry>
69
+
<entry>
70
+
Square brackets are used to create ranges of ASCII codepoints or sets of characters.
71
+
For example, pattern <literal>"index.php[45]"</literal> will match <literal>"index.php4"</literal> and
72
+
<literal>"index.php5"</literal>, but will not match <literal>"index.phpt"</literal>.
73
+
Well known ranges are <literal>[0-9]</literal>, <literal>[a-z]</literal>, and <literal>[A-Z]</literal>.
74
+
Multiple sets and ranges can be used at the same time, for example <literal>[0-9a-zABC]</literal>.
75
+
</entry>
76
+
</row>
77
+
<row>
78
+
<entry>
79
+
<literal>!</literal>
80
+
</entry>
81
+
<entry>
82
+
Exclamation mark is used to negate characters within square brackets.
83
+
For example, <literal>"[!A-Z]*.html"</literal> will match <literal>"demo.html"</literal>, but will not match
84
+
<literal>"Demo.html"</literal>.
85
+
</entry>
86
+
</row>
87
+
<row>
88
+
<entry>
89
+
<literal>\</literal>
90
+
</entry>
91
+
<entry>
92
+
Backslash is used to escape special characters.
93
+
For example, <literal>"Name\?"</literal> will match <literal>"Name?"</literal>, but will not match
94
+
<literal>"Names"</literal>.
95
+
</entry>
96
+
</row>
97
+
</tbody>
98
+
</tgroup>
99
+
</table>
32
100
</para>
33
101
</listitem>
34
102
</varlistentry>
35
103