]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-133286: add explanation about `seq` for pathlib Pattern Language (GH-133340...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 16 May 2025 19:20:53 +0000 (21:20 +0200)
committerGitHub <noreply@github.com>
Fri, 16 May 2025 19:20:53 +0000 (20:20 +0100)
gh-133286: add explanation about `seq` for pathlib Pattern Language (GH-133340)
(cherry picked from commit ac8df4b5892d2e4bd99731e7d87223a35c238f81)

Co-authored-by: alexey semenyuk <alexsemenyuk88@gmail.com>
Doc/library/pathlib.rst

index ee8a9086d5eaa1362ff2acd4348869ad596f69bf..0e009e4337cdb8dfe01f01e70b74c4a97d345ec8 100644 (file)
@@ -1661,9 +1661,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 ``"?"``.