PageRenderTime 42ms CodeModel.GetById 20ms app.highlight 3ms RepoModel.GetById 17ms app.codeStats 1ms

/jEdit/tags/jedit-4-1-pre5/doc/users-guide/globs.xml

#
XML | 67 lines | 64 code | 1 blank | 2 comment | 0 complexity | cfe828e07088f6eeaec67574481a8e9e MD5 | raw file
 1<!-- jEdit buffer-local properties: -->
 2<!-- :indentSize=1:noTabs=true: -->
 3
 4<appendix id="globs"><title>Glob Patterns</title>
 5 <para>
 6  jEdit uses glob patterns similar to those in the various
 7  Unix shells to implement file name filters in the file system browser.
 8  Glob patterns resemble regular expressions somewhat,
 9  but have a much simpler
10  syntax. The following character sequences have special meaning within a glob
11  pattern:
12 </para>
13 <itemizedlist>
14  <listitem><para><literal>?</literal> matches any one character</para></listitem>
15  <listitem><para><literal>*</literal> matches any number of characters</para></listitem>
16  <listitem><para><literal>{!<replaceable>glob</replaceable>}</literal>
17  Matches anything that <emphasis>does not</emphasis> match
18  <replaceable>glob</replaceable></para></listitem>
19  <listitem><para><literal>{<replaceable>a</replaceable>,<replaceable>b</replaceable>,<replaceable>c</replaceable>}</literal>
20  matches any one of <replaceable>a</replaceable>, <replaceable>b</replaceable> or
21  <replaceable>c</replaceable></para></listitem>
22  <listitem><para><literal>[<replaceable>abc</replaceable>]</literal> matches
23  any character in
24  the set <replaceable>a</replaceable>, <replaceable>b</replaceable> or
25  <replaceable>c</replaceable></para></listitem>
26  <listitem><para><literal>[^<replaceable>abc</replaceable>]</literal> matches
27  any character not
28  in the set <replaceable>a</replaceable>, <replaceable>b</replaceable> or
29  <replaceable>c</replaceable></para></listitem>
30  <listitem><para><literal>[<replaceable>a-z</replaceable>]</literal> matches
31  any character in the
32  range <replaceable>a</replaceable> to <replaceable>z</replaceable>, inclusive.
33  A leading or trailing dash will be interpreted literally</para></listitem>
34 </itemizedlist>
35 <para>
36  In addition to the above, a number of <quote>character class
37  expressions</quote> may be used as well:
38 </para>
39 <itemizedlist>
40  <listitem><para><literal>[[:alnum:]]</literal> matches any alphanumeric
41  character</para></listitem>
42  <listitem><para><literal>[[:alpha:]]</literal> matches any alphabetical character</para></listitem>
43  <listitem><para><literal>[[:blank:]]</literal> matches a space or horizontal tab</para></listitem>
44  <listitem><para><literal>[[:cntrl:]]</literal> matches a control character</para></listitem>
45  <listitem><para><literal>[[:digit:]]</literal> matches a decimal digit</para></listitem>
46  <listitem><para><literal>[[:graph:]]</literal> matches a non-space, non-control character</para></listitem>
47  <listitem><para><literal>[[:lower:]]</literal> matches a lowercase letter</para></listitem>
48  <listitem><para><literal>[[:print:]]</literal> same as <literal>[:graph:]</literal>, but also space and tab</para></listitem>
49  <listitem><para><literal>[[:punct:]]</literal> matches a punctuation character</para></listitem>
50  <listitem><para><literal>[[:space:]]</literal> matches any whitespace character, including newlines</para></listitem>
51  <listitem><para><literal>[[:upper:]]</literal> matches an uppercase letter</para></listitem>
52  <listitem><para><literal>[[:xdigit:]]</literal> matches a valid hexadecimal digit</para></listitem>
53 </itemizedlist>
54 <para>
55  Here are some examples of glob patterns:
56 </para>
57 <itemizedlist>
58  <listitem><para><userinput>*</userinput> - all files</para></listitem>
59  <listitem><para><userinput>*.java</userinput> - all files whose names end with
60  <quote>.java</quote></para></listitem>
61  <listitem><para><userinput>*.{c,h}</userinput> - all files whose names end
62  with either
63  <quote>.c</quote> or <quote>.h</quote></para></listitem>
64  <listitem><para><userinput>*[^~]</userinput> - all files whose names do not
65  end with <quote>~</quote></para></listitem>
66 </itemizedlist>
67</appendix>