I have the database with the specific names. I need to iterate the database records and find the records which have the appropriate pattern. For example: Pattern with wildcard: abc.*.cde
File name: abc.123.cde
How can I check that the name "abc.123.cde" is a part of the pattern "abc.*.cde" ?
Seems I have to use the fnmatch module:
fnmatch.fnmatch(files, 'abc.*.cde')
Will return me the files according to the pattern.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.