## Appendix D. Glob Patterns

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:

- `?` matches any one character

- `*` matches any number of characters

- `{!`glob`}` Matches anything that does not match `glob`

- `{`a`,`b`,`c`}` matches any one of `a`, `b` or `c`

- `[`abc`]` matches any character in the set `a`, `b` or `c`

- `[^`abc`]` matches any character not in the set `a`, `b` or `c`

- `[`a-z`]` matches any character in the range `a` to `z`, inclusive. A leading or trailing dash will be interpreted literally

In addition to the above, a number of “character class expressions” may be used as well:

- `[[:alnum:]]` matches any alphanumeric character

- `[[:alpha:]]` matches any alphabetical character

- `[[:blank:]]` matches a space or horizontal tab

- `[[:cntrl:]]` matches a control character

- `[[:digit:]]` matches a decimal digit

- `[[:graph:]]` matches a non-space, non-control character

- `[[:lower:]]` matches a lowercase letter

- `[[:print:]]` same as `[[:graph:]]`, but also space and tab

- `[[:punct:]]` matches a punctuation character

- `[[:space:]]` matches any whitespace character, including newlines

- `[[:upper:]]` matches an uppercase letter

- `[[:xdigit:]]` matches a valid hexadecimal digit

Here are some examples of glob patterns:

- `*` - all files.

- `*.java` - all files whose names end with “.java”.

- `*.[ch]` - all files whose names end with either “.c” or “.h”.

- `[^#]*` - all files whose names do not start with “#”.