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

/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
  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>a</replaceable>,<replaceable>b</replaceable>,<replaceable>c</replaceable>}</literal>
  16. matches any one of <replaceable>a</replaceable>, <replaceable>b</replaceable> or
  17. <replaceable>c</replaceable></para></listitem>
  18. <listitem><para><literal>[<replaceable>abc</replaceable>]</literal> matches
  19. any character in
  20. the set <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 not
  24. in the set <replaceable>a</replaceable>, <replaceable>b</replaceable> or
  25. <replaceable>c</replaceable></para></listitem>
  26. <listitem><para><literal>[<replaceable>a-z</replaceable>]</literal> matches
  27. any character in the
  28. range <replaceable>a</replaceable> to <replaceable>z</replaceable>, inclusive.
  29. A leading or trailing dash will be interpreted literally</para></listitem>
  30. </itemizedlist>
  31. <para>
  32. Within a character class expression, the following sequences have special meaning:
  33. </para>
  34. <itemizedlist>
  35. <listitem><para><literal>[:alnum:]</literal> Any alphanumeric
  36. character</para></listitem>
  37. <listitem><para><literal>[:alpha:]</literal> Any alphabetical character</para></listitem>
  38. <listitem><para><literal>[:blank:]</literal> A space or horizontal tab</para></listitem>
  39. <listitem><para><literal>[:cntrl:]</literal> A control character</para></listitem>
  40. <listitem><para><literal>[:digit:]</literal> A decimal digit</para></listitem>
  41. <listitem><para><literal>[:graph:]</literal> A non-space, non-control character</para></listitem>
  42. <listitem><para><literal>[:lower:]</literal> A lowercase letter</para></listitem>
  43. <listitem><para><literal>[:print:]</literal> Same as <literal>[:graph:]</literal>, but also space and tab</para></listitem>
  44. <listitem><para><literal>[:punct:]</literal> A punctuation character</para></listitem>
  45. <listitem><para><literal>[:space:]</literal> Any whitespace character, including newlines</para></listitem>
  46. <listitem><para><literal>[:upper:]</literal> An uppercase letter</para></listitem>
  47. <listitem><para><literal>[:xdigit:]</literal> A valid hexadecimal digit</para></listitem>
  48. </itemizedlist>
  49. <para>
  50. Here are some example glob patterns:
  51. </para>
  52. <itemizedlist>
  53. <listitem><para><userinput>*</userinput> - all files</para></listitem>
  54. <listitem><para><userinput>*.java</userinput> - all files whose names end with
  55. <quote>.java</quote></para></listitem>
  56. <listitem><para><userinput>*.{c,h}</userinput> - all files whose names end
  57. with either
  58. <quote>.c</quote> or <quote>.h</quote></para></listitem>
  59. <listitem><para><userinput>*[^~]</userinput> - all files whose names do not
  60. end with <quote>~</quote></para></listitem>
  61. </itemizedlist>
  62. </appendix>