PageRenderTime 51ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

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