Syntax
Although there is no definite syntax for globs, common features include:
Task | Example | Unix shells | COMMAND.COM |
cmd.exe |
Windows PowerShell | SQL (within string literals) | SAP |
---|---|---|---|---|---|---|---|
Match one or zero unknown characters | ?at matches at , Cat , cat , Bat or bat |
? |
? |
? |
|||
Match exactly one unknown character | ?at matches Cat , cat , Bat or bat , but not at |
? |
_ |
+ |
|||
Match any number of unknown characters | Law* matches Law , Laws , or Lawyer |
* |
* |
* |
* |
% |
* |
Match a character as part of a group of characters | at matches Cat or Bat but not cat or bat |
|
|
||||
Escape character | Law\* will only match Law* |
\ |
^ |
` |
Globs do not include syntax for the Kleene star which allows multiple repetitions of the preceding part of the expression; thus they are not considered regular expressions, which can describe a larger set of regular languages over any given finite alphabet.
Read more about this topic: Glob (programming)