On May 9, 6:52 pm, John Machin <[EMAIL PROTECTED]> wrote: > Paul McGuire wrote: > > from re import * > > Perhaps you intended "import re".
Indeed I did. > <snip> > > > Both print "prince". > > No they don't. The result is "NameError: name 're' is not defined". Dang, now how did that work in my script? I assure you I did test it before posting. Ah! My pyparsing prototype preceded the regex version in the same script, and importing the pyparsing module imports re using "import re". That is why I didn't get NameError. Sorry for sloppy posting... Once you clean up the mistakes, you essentially get the same code as earlier posted by Matimus. -- Paul -- http://mail.python.org/mailman/listinfo/python-list