On Fri, Apr 1, 2011 at 8:14 AM, Wehe, Marco <marco.w...@bskyb.com> wrote: > > I am doing a search through a list of files but the text the casing doesn't > match. My list is all upper case but the real files are all different. Is > there a smooth way of searching through the list without going full on > regular expressions? > > if iFile in media:
If you know they're *all* uppercase, the easiest way is to replace this line with: if iFile.upper() in media: It's not case insensitive per se. For true case insensitivity, force media[] to be all-uppercase too: media=[f.upper() for f in media] Or you can equally use lower() instead of upper(). Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list