GlobDialect Enum
Specifies the glob pattern dialect to use when parsing a pattern.
public enum GlobDialectFields
| Name | Value | Description |
|---|---|---|
Standard | 0 | Use the default glob pattern syntax: *, ?, **, bracket expressions, {a,b} sets, \ escapes and a leading ! to negate the pattern. A leading / makes the pattern absolute. Wildcards do not match a leading dot unless GlobOptions.MatchLeadingDot is set. |
Git | 1 | Use gitignore pattern syntax, as described by gitignore(5) and implemented by git's wildmatch: a pattern without a / matches a name at any depth, a leading / anchors it, and a trailing / only matches directories. Bracket expressions accept ^ as a negation, escapes and character classes such as [[:alpha:]], and braces are ordinary characters. An entry that git can never match, such as one holding an unterminated bracket expression, is rejected. |
MSBuild | 2 | Use MSBuild glob pattern syntax: *, ? and **, where both / and \ are path separators and %XX escapes a character. A file name made of *.* matches every file, including the ones without an extension, a leading .. is kept, and a leading separator makes the pattern absolute. Wildcards match a leading dot. |
Posix | 3 | Use POSIX fnmatch pattern syntax without path-separator awareness, as fnmatch with no flag: the pattern matches a plain string, and *, ? and bracket expressions also match a /. Bracket expressions support ^ as a negation, escapes, character classes such as [[:alpha:]], equivalence classes such as [[=a=]] and collating symbols such as [[.-.]], and a [ that does not open a complete bracket expression is an ordinary character. |
PosixPath | 4 | Use POSIX fnmatch pattern syntax where ordinary wildcards do not cross path separators, as fnmatch with FNM_PATHNAME: a / is only matched by a / of the pattern, and every / is significant, including a leading one. The syntax is the one of GlobDialect.Posix. |
GitHubCodeOwners | 5 | Use the pattern syntax of GitHub CODEOWNERS files, which follows most of the gitignore rules: a pattern without a / matches a name at any depth, a leading / anchors it, a trailing / only matches a directory and everything below it, and ** matches any number of directories. A pattern that matches a directory also matches every path below it, except a pattern whose last segment is *, such as docs/*, which only matches the names directly in the directory. GitHub does not support bracket expressions or negations, so [, ] and a leading ! are ordinary characters. Wildcards match a leading dot. |
GitLabCodeOwners | 6 | Use the pattern syntax of GitLab CODEOWNERS files: GitLab adds /**/ before a pattern that does not start with a / and **/* after a pattern that ends with a /, then matches the whole path with Ruby's File.fnmatch and the FNM_PATHNAME and FNM_DOTMATCH flags. A pattern that does not end with a /, such as /docs, only matches that path, not the paths below it. ** only matches any number of directories when a / follows it; otherwise it is a *. Bracket expressions accept ! and ^ as a negation and escapes, but no character classes. Wildcards match a leading dot. A leading ! is an ordinary character: GitLab reads it as an exclusion of the CODEOWNERS file, not as a part of the pattern. |