Re: Case-insensitive globbing
From: Eddie Corns (eddie_at_holyrood.ed.ac.uk)
Date: 06/03/04
- Next message: Matthew Thorley: "Re: Python reference"
- Previous message: Terry Reedy: "Re: question regarding Guido's main article"
- In reply to: Thomas Philips: "Case-insensitive globbing"
- Next in thread: Dennis Lee Bieber: "Re: Case-insensitive globbing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 3 Jun 2004 18:03:15 +0000 (UTC)
tkpmep@hotmail.com (Thomas Philips) writes:
>I'm using the function glob from module glob to obtain a list of all
>files in a directory that match a pattern. Unfortunately, some
>filenames are in upper case, others are in lower case and yet others
>are in mixed case. How can I do a case-insenstive glob that picks up
>all files that match a string regardless of case? If its any help, I'm
>running Python 2.3.4 under Windows XP.
If it works the same as it does on Unix then you can use the [Xx] construct
for each of the characters, eg *[Ff][Oo][Oo]* but I'll bet there are better
ways to do the task.
Eddie
- Next message: Matthew Thorley: "Re: Python reference"
- Previous message: Terry Reedy: "Re: question regarding Guido's main article"
- In reply to: Thomas Philips: "Case-insensitive globbing"
- Next in thread: Dennis Lee Bieber: "Re: Case-insensitive globbing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|