Skip to content

Commit 3362193

Browse files
committed
Update fnmatch to prefixmatch
1 parent f82c1fc commit 3362193

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/fnmatch.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`, :func:`.filter
103103
.. function:: translate(pat)
104104

105105
Return the shell-style pattern *pat* converted to a regular expression for
106-
using with :func:`re.match`. The pattern is expected to be a :class:`str`.
106+
using with :func:`re.prefixmatch`. The pattern is expected to be a
107+
:class:`str`.
107108

108109
Example:
109110

@@ -113,7 +114,7 @@ functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`, :func:`.filter
113114
>>> regex
114115
'(?s:.*\\.txt)\\z'
115116
>>> reobj = re.compile(regex)
116-
>>> reobj.match('foobar.txt')
117+
>>> reobj.prefixmatch('foobar.txt')
117118
<re.Match object; span=(0, 10), match='foobar.txt'>
118119

119120

0 commit comments

Comments
 (0)