Quarto Glob Syntax


Quarto sometimes allows you to provide a path or paths using glob syntax, providing wildcard expansion and other behavior that makes it simple to match a list of files without having to specify each file individually. Globs may be used:

Glob Syntax

The below is a general reference of the syntax used for globs in Quarto. Note that globs match the filesystem recursively. If you prefer that they don’t, then prefix the pattern with a / (for example, use /*.qmd rather than *.qmd).

  • * - Matches everything.
  • {foo,bar} - Matches foo or bar.
  • [abcd] - Matches a, b, c or d.
  • [a-d] - Matches a, b, c or d.
  • [!abcd] - Matches any single character besides a, b, c or d.
  • [[:<class>:]] - Matches any character belonging to <class>.
  • \ - Escapes the next character for an os other than "windows".
  • ` - Escapes the next character for os set to "windows".
  • / - Path separator.
  • \ - Additional path separator only for os set to "windows".
  • ?(foo|bar) - Matches 0 or 1 instance of {foo,bar}.
  • @(foo|bar) - Matches 1 instance of {foo,bar}. They behave the same.
  • *(foo|bar) - Matches n instances of {foo,bar}.
  • +(foo|bar) - Matches n > 0 instances of {foo,bar}.
  • !(foo|bar) - Matches anything other than {foo,bar}.
  • ** - Matches any number of any path segments.