@@ -10,20 +10,18 @@ class File < IO::FileDescriptor
10
10
#
11
11
# The pattern syntax is similar to shell filename globbing. It may contain the following metacharacters:
12
12
#
13
- # * `*` matches an unlimited number of arbitrary characters, excluding any directory separators.
14
- # * `"*"` matches all regular files.
15
- # * `"c*"` matches all files beginning with `c`.
16
- # * `"*c"` matches all files ending with `c`.
17
- # * `"*c*"` matches all files that have `c` in them (including at the beginning or end).
18
- # * `**` matches directories recursively if followed by `/`.
19
- # If this path segment contains any other characters, it is the same as the usual `*`.
20
- # * `?` matches one arbitrary character, excluding any directory separators.
13
+ # * `*`: Wildcard matches zero or more characters, except for directory separators.
14
+ # * `**`: Globstar matches zero or more characters, including directory separators.
15
+ # It must match a complete path segment, i.e. it must be wrapped in `/`
16
+ # except for the beginning and end of the pattern.
17
+ # * `?`: Matches a single Unicode character, except for directory separators.
21
18
# * character sets:
22
- # * `[abc]` matches any one of these characters.
23
- # * `[^abc]` matches any one character other than these.
24
- # * `[a-z]` matches any one character in the range.
25
- # * `{a,b}` matches subpattern `a` or `b`.
26
- # * `\\` escapes the next character.
19
+ # * `[abc]`: Character set matches one of the Unicode characters contained in the brackets.
20
+ # * `[^abc]`: Negated character set matches any Unicode character _except_ those contained in the brackes.
21
+ # * `[a-z]`: Character range matches one Unicode character contained in the character range.
22
+ # * `{a,b}`: Branches matches one of the subpatterns contained in the braces. Subpatterns
23
+ # may contain any other pattern feature, including nested branches (max nesting depth is 10 levels deep).
24
+ # * `\\`: Backslash escapes the next character.
27
25
#
28
26
# If *path* is a `Path`, all directory separators supported by *path* are
29
27
# recognized, according to the path's kind. If *path* is a `String`, only `/`
0 commit comments