- Where regular expressions use . to indicate any character, wild cards use ?. This is due to the fact that Unix shells tend to hide files that begin with a literal period by default.
- For a similar reason, wild cards change the idiom "match any number of characters" from regular expression's .* to *
- Where regular expressions use | to indicate a choice between text alternatives, wild card uses , due to the fact that | is normally a shell command for constructing a pipe
Glob-style wild-card characters* matches any string of characters (including the empty string)
(similar in concept to the regular expression .*)? matches any single character.
(similar in concept to the regular expression .)[...] matches a set of characters (need more detail)
(similar in concept to the regular expression [[a-z], etc.){alt1,alt2} matches alternatives (but not in [string match])
(similar in concept to the regular expression {text|text}(Wiki bug: can't have unbalanced braces inside font context, so alt1 and alt2 are erroneously bold.)\\ forces the next character to be interpreted as a literal. (Wiki bug: single backslash causes crash.)Examples
- ab*cd
- Matches a string with ab at the start and cd at the end
- ab?cd
- Matches a string 5 characters long with ab at the start and cd at the end.
- ab[cd]
- Matches a string 3 characters long starting with ab followed by c or d
- ab[c-e]f
- Matches a string 4 characters long starting with ab, followed by a c, d or e and with an f at the end.
- ab{c,?c}d
- Matches any string 4 or 5 characters long with ab at the start and cd at the end.
- a\*c
- Matches precisely the string a*c character