Syntax
The syntax for glob patterns is as follows: pattern ::=char* | char* "?" | char* "" | char "?" | char* "" | "{" char "," char* "}" | "{" char* "," char* "," char* "}" | "[" char* "-" char* "]" | "[" char* "-" char* "]" | "[" char* "]" | "[" char* "]"
Where:
char is any character except \*, ?, [, ], {, }, ", or '.
Examples
The following table shows some examples of glob patterns and their meanings:
Advanced Features
Glob patterns also support some advanced features, such as recursive matching and negative matching.
Recursive matching: The
** pattern matches any sequence of directories, including zero or more directories.
For example, the pattern **/*.txt matches any file with a .txt extension, regardless of how many directories it is nested in.
Negative matching: The ! character can be used to negate a pattern. For example, the pattern !*.txt matches any file that does not have a .txt extension.