GH-73435: Implement recursive wildcards in `pathlib.PurePath.match()` by barneygale · Pull Request #101398 · python/cpython
…ch() Add a new *recursive* argument to `pathlib.PurePath.match()`, defaulting to `False`. If set to true, `match()` handles the `**` wildcard as in `Path.glob()`, i.e. it matches any number of path segments. We now compile a `re.Pattern` object for the entire pattern. This is made more difficult by `fnmatch` not treating directory separators as special when evaluating wildcards (`*`, `?`, etc), and so we arrange the path parts onto separate *lines* in a string, and ensure we don't set `re.DOTALL`.
This was referenced
Mar 12, 2023
barneygale
changed the title
gh-73435: Implement recursive wildcards in pathlib.PurePath.match()
GH-73435: Implement recursive wildcards in pathlib.PurePath.match()
This was referenced
Jul 2, 2023This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters