Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ceaebc3

Browse files
committed
Merged revisions 75041 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ................ r75041 | ezio.melotti | 2009-09-24 00:42:25 +0300 (Thu, 24 Sep 2009) | 9 lines Merged revisions 75039 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r75039 | ezio.melotti | 2009-09-24 00:36:39 +0300 (Thu, 24 Sep 2009) | 1 line improved phrasing, markup and example ........ ................
1 parent 239db95 commit ceaebc3

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

Doc/library/fnmatch.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ patterns.
3636

3737
.. function:: fnmatch(filename, pattern)
3838

39-
Test whether the *filename* string matches the *pattern* string, returning true
40-
or false. If the operating system is case-insensitive, then both parameters
41-
will be normalized to all lower- or upper-case before the comparison is
42-
performed. If you require a case-sensitive comparison regardless of whether
43-
that's standard for your operating system, use :func:`fnmatchcase` instead.
39+
Test whether the *filename* string matches the *pattern* string, returning
40+
:const:`True` or :const:`False`. If the operating system is case-insensitive,
41+
then both parameters will be normalized to all lower- or upper-case before
42+
the comparison is performed. :func:`fnmatchcase` can be used to perform a
43+
case-sensitive comparison, regardless of whether that's standard for the
44+
operating system.
4445

4546
This example will print all file names in the current directory with the
4647
extension ``.txt``::
@@ -55,8 +56,8 @@ patterns.
5556

5657
.. function:: fnmatchcase(filename, pattern)
5758

58-
Test whether *filename* matches *pattern*, returning true or false; the
59-
comparison is case-sensitive.
59+
Test whether *filename* matches *pattern*, returning :const:`True` or
60+
:const:`False`; the comparison is case-sensitive.
6061

6162

6263
.. function:: filter(names, pattern)
@@ -77,7 +78,7 @@ patterns.
7778
>>> regex
7879
'.*\\.txt$'
7980
>>> reobj = re.compile(regex)
80-
>>> print(reobj.match('foobar.txt'))
81+
>>> reobj.match('foobar.txt')
8182
<_sre.SRE_Match object at 0x...>
8283

8384

0 commit comments

Comments
 (0)