Expand description
Pattern matching utilities for file filtering.
This module provides glob-style pattern matching compatible with Sphinx’s include_patterns and exclude_patterns functionality. It implements the same pattern translation and matching logic as Sphinx’s util/matching.py.
Functions§
- compile_
pattern - Compiles a pattern into a regex, using cache for performance.
- get_
matching_ files - Gets matching files from a directory using include and exclude patterns.
- normalize_
path - Normalizes a path to use forward slashes for pattern matching. This ensures consistent behavior across platforms.
- pattern_
filter - Filters a list of names by a glob pattern.
- pattern_
match - Tests if a name matches a glob pattern.
- translate_
pattern - Translates shell-style glob pattern to regex pattern.