/jEdit/tags/jedit-4-0-pre3/doc/users-guide/globs.xml
XML | 63 lines | 60 code | 1 blank | 2 comment | 0 complexity | cd9ab15fd9c9bed83e6afbe216353d73 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- <!-- jEdit buffer-local properties: -->
- <!-- :indentSize=1:noTabs=true: -->
- <appendix id="globs"><title>Glob Patterns</title>
- <para>
- jEdit uses glob patterns similar to those in the various
- Unix shells to implement file name filters in the file system browser.
- Glob patterns resemble regular expressions somewhat,
- but have a much simpler
- syntax. The following character sequences have special meaning within a glob
- pattern:
- </para>
- <itemizedlist>
- <listitem><para><literal>?</literal> matches any one character</para></listitem>
- <listitem><para><literal>*</literal> matches any number of characters</para></listitem>
- <listitem><para><literal>{<replaceable>a</replaceable>,<replaceable>b</replaceable>,<replaceable>c</replaceable>}</literal>
- matches any one of <replaceable>a</replaceable>, <replaceable>b</replaceable> or
- <replaceable>c</replaceable></para></listitem>
- <listitem><para><literal>[<replaceable>abc</replaceable>]</literal> matches
- any character in
- the set <replaceable>a</replaceable>, <replaceable>b</replaceable> or
- <replaceable>c</replaceable></para></listitem>
- <listitem><para><literal>[^<replaceable>abc</replaceable>]</literal> matches
- any character not
- in the set <replaceable>a</replaceable>, <replaceable>b</replaceable> or
- <replaceable>c</replaceable></para></listitem>
- <listitem><para><literal>[<replaceable>a-z</replaceable>]</literal> matches
- any character in the
- range <replaceable>a</replaceable> to <replaceable>z</replaceable>, inclusive.
- A leading or trailing dash will be interpreted literally</para></listitem>
- </itemizedlist>
- <para>
- Within a character class expression, the following sequences have special meaning:
- </para>
- <itemizedlist>
- <listitem><para><literal>[:alnum:]</literal> Any alphanumeric
- character</para></listitem>
- <listitem><para><literal>[:alpha:]</literal> Any alphabetical character</para></listitem>
- <listitem><para><literal>[:blank:]</literal> A space or horizontal tab</para></listitem>
- <listitem><para><literal>[:cntrl:]</literal> A control character</para></listitem>
- <listitem><para><literal>[:digit:]</literal> A decimal digit</para></listitem>
- <listitem><para><literal>[:graph:]</literal> A non-space, non-control character</para></listitem>
- <listitem><para><literal>[:lower:]</literal> A lowercase letter</para></listitem>
- <listitem><para><literal>[:print:]</literal> Same as <literal>[:graph:]</literal>, but also space and tab</para></listitem>
- <listitem><para><literal>[:punct:]</literal> A punctuation character</para></listitem>
- <listitem><para><literal>[:space:]</literal> Any whitespace character, including newlines</para></listitem>
- <listitem><para><literal>[:upper:]</literal> An uppercase letter</para></listitem>
- <listitem><para><literal>[:xdigit:]</literal> A valid hexadecimal digit</para></listitem>
- </itemizedlist>
- <para>
- Here are some example glob patterns:
- </para>
- <itemizedlist>
- <listitem><para><userinput>*</userinput> - all files</para></listitem>
- <listitem><para><userinput>*.java</userinput> - all files whose names end with
- <quote>.java</quote></para></listitem>
- <listitem><para><userinput>*.{c,h}</userinput> - all files whose names end
- with either
- <quote>.c</quote> or <quote>.h</quote></para></listitem>
- <listitem><para><userinput>*[^~]</userinput> - all files whose names do not
- end with <quote>~</quote></para></listitem>
- </itemizedlist>
- </appendix>