2009/2/7 Just Another Victim of the Ambient Morality <ihates...@hotmail.com>: > I'm confused by this behaviour: > > > import re > > regex = re.compile('foo') > match = regex.match('whatfooever') > > > In my experience with regular expressions, regex should have found a > match. However, in this case regex.match() returns None. Why is that? > What am I missing? > Thank you... > > > > -- > http://mail.python.org/mailman/listinfo/python-list >
Try re.search() instead of match(), if nod only the beginning should be checked for a match: see http://docs.python.org/library/re.html#matching-vs-searching vbr -- http://mail.python.org/mailman/listinfo/python-list