← TechnologyThe essentials of

Fnmatch: filename patterns rather than regular expressions

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 16:11 · Updated: 22 Oct 2026 16:11

AI source check: 22 Oct 2026 14:04. This is not editorial approval.

In a few sentences

In brief

fnmatch compares names with shell-style patterns. fnmatch.fnmatchcase('report.csv', '*.csv') is True, and fnmatchcase preserves case sensitivity.

Useful to know

fnmatch compares names with shell-style patterns. fnmatch.fnmatchcase('report.csv', '*.csv') is True, and fnmatchcase preserves case sensitivity. [1]

These patterns are not the full grammar of regular expressions. The module does not traverse directories for you. Decide whether you are checking a name or a full path, and do not treat an extension match as proof of a file’s actual type.

Sources

For further detail and to check the information:

  1. [1] fnmatch — Unix filename pattern matching — Python 3.12.15 documentation ↗