I often encounter glob patterns at work, such as include configs in eslint/tsc, file filtering in shell, and IDE file masks. I never learned them systematically, so I used them inefficiently. I’m documenting them here.

Glob vs regex
After reading some materials, here are my notes:
Glob is not regex, and metacharacters differ. For example,
?means a single character in glob, while in regex it means the previous token is optional.So you must distinguish glob and regex metacharacters.
Glob and regex are used differently.
Regex is for text processing, like searching in content, whileglob is for file matching. It is not that glob cannot be used for text, or regex cannot be used for files, but this is the common convention.Regex is more powerful, while glob is concise.
There are many glob syntax guides online, so I won’t list them here.
Practice glob
The best way is practice, especially common wildcards like ** and ?.
I recommend this site for testing patterns online:
File Masks
In WebStorm, a common feature is search with file masks. It turns out file masks are a subset of glob with extensions (comma for multiple patterns).
So you can use *.css,*.less to match multiple file types.

Final Thoughts
Glob is like regex: not always high-frequency, but a basic skill. Practice and memorize.

