> > Regular expressions are a little evil at times; here's what I think you're > thinking of: > > ### > >>> import re > >>> pattern = re.compile(r"""dog(?!cat) > ... | (?<=dogcat)""", re.VERBOSE) > >>> pattern.match('dogman').start() > 0 > >>> pattern.search('dogcatcher').start()
Hi Mike, Gaaah, bad copy-and-paste. The example with 'dogcatcher' actually does come up with a result: ### >>> pattern.search('dogcatcher').start() 6 ### Sorry about that! _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor