]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-133286: add explanation about `seq` for pathlib Pattern Language (#133340)
authoralexey semenyuk <alexsemenyuk88@gmail.com>
Fri, 16 May 2025 18:42:06 +0000 (23:42 +0500)
committerGitHub <noreply@github.com>
Fri, 16 May 2025 18:42:06 +0000 (18:42 +0000)
Doc/library/pathlib.rst

index 7d7692dea5c38cec7e03b7fdc9a1f8f96d5e67c2..86351e65dc4ed6080adac5f680c18778008aa2a8 100644 (file)
@@ -1781,9 +1781,12 @@ The following wildcards are supported in patterns for
 ``?``
   Matches one non-separator character.
 ``[seq]``
-  Matches one character in *seq*.
+  Matches one character in *seq*, where *seq* is a sequence of characters.
+  Range expressions are supported; for example, ``[a-z]`` matches any lowercase ASCII letter.
+  Multiple ranges can be combined: ``[a-zA-Z0-9_]`` matches any ASCII letter, digit, or underscore.
+
 ``[!seq]``
-  Matches one character not in *seq*.
+  Matches one character not in *seq*, where *seq* follows the same rules as above.
 
 For a literal match, wrap the meta-characters in brackets.
 For example, ``"[?]"`` matches the character ``"?"``.