PageRenderTime 169ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre4/doc/users-guide/globs.xml

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