When matching a string (a sequence of characters containing an extension or a virtual path) with a pattern, the following rules apply:
* matches any sequence of characters with any length (zero or more),
? matches any character,
[set] matches any character in the specified set,
[!set] or [^set] matches any character not in the specified set,
\ suppresses the syntactic significance of a special character.
A set is made of characters or ranges. A range is formed by two characters with a - in the middle (as in 0-9 or a-z).
Preceding a special character with \ makes it loose its syntactic significance and match that character exactly. The special characters are *?!^-\.
Example D-1. Examples of Patterns
*: any string including the empty string matches with this pattern.
*.*: list.txt and holiday.jpeg match while my-directory doesn't.
/*.php: /hello.php and /mysite/scripts/test.php match but /mysite/test2.pl doesn't.
/*/*.php: /mysite/test.php and /mysite/scripts/test.php match with this pattern while /test.php doesn't.
mp?: Any 3 character long string that begins with mp matches.
?????: Any 5 character long string matches.
mp[2-4]: Only mp2, mp3, and mp4 match.
mp[!2-4]: All 3 character long strings that begin with mp match except mp2, mp3, and mp4.
mp[2-4g]: Only mp2, mp3, mp4, and mpg match.
mp[2\-4]file: Only mp2file, mp-file, and mp4file match.