I'm expecting a string NOT to match a regular expression, but it is!
>>> re.compile('^P|([LA]E?)$').match('PE').group()
'P'
This seems like a bug, because I see no way for the $ to match. On the other hand, it seems unlikely that Python's re lib would not be able to handle this simple case. Am I missing something here?
btw, Python prints this out when I start it:
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.