PurePath.match(pattern)
Match this path against the provided glob-style pattern. Return True
if matching is successful, False
otherwise.
If pattern is relative, the path can be either relative or absolute, and matching is done from the right:
1 2 3 4 5 6 | >>> PurePath( 'a/b.py' ).match( '*.py' ) True >>> PurePath( '/a/b/c.py' ).match( 'b/*.py' ) True >>> PurePath( '/a/b/c.py' ).match( 'a/*.py' ) False |
If pattern is absolute, the path must be absolute, and the whole path must match:
1 2 3 4 | >>> PurePath( '/a.py' ).match( '/*.py' ) True >>> PurePath( 'a/b.py' ).match( '/*.py' ) False |
As with other methods, case-sensitivity is observed:
1 2 | >>> PureWindowsPath( 'b.py' ).match( '*.PY' ) True |
Please login to continue.