"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul McGuire wrote: > > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >> where '*' matches one or more characters, and '?' matches any single > > > > oops, I meant '*' matches zero or more characters. > > '?' also matches 0 characters
Maybe it does, and maybe it doesn't... :) Here is my test with the glob module (in my directory, there is a file named PUTTY.RND): >>> glob.glob('PUTTY.RND') ['PUTTY.RND'] >>> glob.glob('PUTTY.RN?') ['PUTTY.RND'] >>> glob.glob('PUTTY.RN?D') [] >>> glob.glob('PUTTY.RN?') ['PUTTY.RND'] >>> glob.glob('PUTTY.RND?') [] >>> glob.glob('PUTT?.RND') ['PUTTY.RND'] >>> glob.glob('PUTTY?.RND') [] >>> glob.glob('PUTT?Y.RND') [] >>> Looks like '?' does *not* match zero characters in glob. On the other hand, in the Windows console window, it appears that '?' *does* match zero characters. Of course, you could write your regexp() routine to interpret '?' any way you wanted. -- Paul -- http://mail.python.org/mailman/listinfo/python-list