/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
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>glob</replaceable>}</literal>
- Matches anything that <emphasis>does not</emphasis> match
- <replaceable>glob</replaceable></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>
- In addition to the above, a number of <quote>character class
- expressions</quote> may be used as well:
- </para>
- <itemizedlist>
- <listitem><para><literal>[[:alnum:]]</literal> matches any alphanumeric
- character</para></listitem>
- <listitem><para><literal>[[:alpha:]]</literal> matches any alphabetical character</para></listitem>
- <listitem><para><literal>[[:blank:]]</literal> matches a space or horizontal tab</para></listitem>
- <listitem><para><literal>[[:cntrl:]]</literal> matches a control character</para></listitem>
- <listitem><para><literal>[[:digit:]]</literal> matches a decimal digit</para></listitem>
- <listitem><para><literal>[[:graph:]]</literal> matches a non-space, non-control character</para></listitem>
- <listitem><para><literal>[[:lower:]]</literal> matches 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> matches a punctuation character</para></listitem>
- <listitem><para><literal>[[:space:]]</literal> matches any whitespace character, including newlines</para></listitem>
- <listitem><para><literal>[[:upper:]]</literal> matches an uppercase letter</para></listitem>
- <listitem><para><literal>[[:xdigit:]]</literal> matches a valid hexadecimal digit</para></listitem>
- </itemizedlist>
- <para>
- Here are some examples of 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>