diff -r 27edae50e62c Doc/library/fnmatch.rst --- a/Doc/library/fnmatch.rst Sun Oct 09 20:19:21 2016 -0700 +++ b/Doc/library/fnmatch.rst Sun Oct 16 15:52:18 2016 +0300 @@ -74,7 +74,8 @@ patterns. .. function:: translate(pattern) - Return the shell-style *pattern* converted to a regular expression. + Return the shell-style *pattern* converted to a regular expression for + using with :func:`re.match`. Example: @@ -82,7 +83,7 @@ patterns. >>> >>> regex = fnmatch.translate('*.txt') >>> regex - '.*\\.txt\\Z(?ms)' + '(?s:.*\\.txt)\\Z' >>> reobj = re.compile(regex) >>> reobj.match('foobar.txt') <_sre.SRE_Match object; span=(0, 10), match='foobar.txt'>