pymovements.utils.paths.match_filepaths#
- pymovements.utils.paths.match_filepaths(path: str | Path, regex: re.Pattern, relative: bool = True, relative_anchor: Path | None = None) list[dict[str, str]] [source]#
Traverse path and match regular expression.
Deprecated since version v0.21.1: This module will be removed in v0.26.0.
- Parameters:
path (str | Path) – Root path to be traversed.
regex (re.Pattern) – Regular expression filenames will be matched against.
relative (bool) – If True, specify filepath as relative to root path. (default: True)
relative_anchor (Path | None) – Specifies root path in case of
relative == True
. If None,path
will be chosen as relative_anchor for recursive calls. (default: None)
- Returns:
Each entry contains the match group dictionary of the regular expression.
- Return type:
list[dict[str, str]]
- Raises:
ValueError – If
path
does not point to a directory... deprecated: – v0.21.1: This function will be removed in v0.26.0.