From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 16 May 2025 19:20:47 +0000 (+0200) Subject: [3.14] gh-133286: add explanation about `seq` for pathlib Pattern Language (GH-133340... X-Git-Tag: v3.14.0b2~138 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8dcde4d5e34893b2017dee6ee50db641514ef34;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-133286: add explanation about `seq` for pathlib Pattern Language (GH-133340) (#134105) gh-133286: add explanation about `seq` for pathlib Pattern Language (GH-133340) (cherry picked from commit ac8df4b5892d2e4bd99731e7d87223a35c238f81) Co-authored-by: alexey semenyuk --- diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 7d7692dea5c3..86351e65dc4e 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -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 ``"?"``.