Skip to content

Instantly share code, notes, and snippets.

@thatisuday
Last active July 9, 2023 19:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thatisuday/097d38314b9aafd148406220cb0f8ea1 to your computer and use it in GitHub Desktop.
Save thatisuday/097d38314b9aafd148406220cb0f8ea1 to your computer and use it in GitHub Desktop.
Glob Pattern Matching
Pattern Description Example Pattern Matches
xyz Match exactly xyz and nothing more photo.db photo.db
* Match any 0 or more characters *s.db photos.db users.db ... (files with s.db suffix)
? Matches any single character ?ing.db king.db ping.db ring.db
[...] Matches one character listed inside the brackets [pr]ing.txt ping.txt ring.txt
[start-end] Matches any character from the start till the end of a set. Supported patterns are a-z; A-Z and 0-9 [m-z]ing.* ping.db ping.txt ring.db ring.txt
[!...] Matches one character not included in the brackets [!pr]ing.txt king.txt
[!start-end] Matches any character not included from the till the end of a set [!m-z]ing.* king.db king.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment