problem with regex

abcd codecraig at gmail.com
Fri Jul 28 09:27:24 EDT 2006


not sure why this passes:


>>> regex = r'[A-Za-z]:\\([^/:\*\?"<>\|])*'
>>> p = re.compile(regex)
>>> p.match('c:\\test')
<_sre.SRE_Match object at 0x009D77E0>
>>> p.match('c:\\test?:/')
<_sre.SRE_Match object at 0x009D7720>
>>>

the last example shouldnt give a match




More information about the Python-list mailing list