Table of Contents

Glob Pattern

Glob pattern are used in Tabulify to select objects such as :

If you are new to glob pattern, see this page Tabulify - How to select data resources with a Glob Pattern

Wildcard support

The following wildcard are supported in order to define the glob pattern:

  • * that matches every characters
  • ** matches all container (directories/schema). Use for recursive search (for instance **/foo.md will search all foo.md files in all sub directories)
  • ? that matches a single character
  • [] that matches a class of character (Example: [0-9] matches all digit)
  • [!] that does not match a character in the class of character. (Example: [!0-9] will not match a digit)
  • {pattern1,pattern2,..} to match a collection of sub-pattern (Example: {temp*,tmp*} matches all data resource name that begins with temp or tmp). It creates also a group for back-referencing.

Back-referencing

When data resources are selected via globbing, they get extra numeric variables that captures the text that matches.

ie:

  • the variable 1 is the text captured by the first glob pattern
  • the variable 2 is the text captured by the second glob pattern
  • and so on.

You can use this extra variable in:

Example with the data list command that:

  • selects the table that starts with web on a tpcds schema
  • shows the 1 first back-reference value
tabul data list -a 1 web_*@tpcds
path          media_type     1
-----------   ------------   -------
web_page      sql/relation   page
web_returns   sql/relation   returns
web_sales     sql/relation   sales
web_site      sql/relation   site