Regular Expression: Bug in findall?

Claude-Guy Quimper cquimper at NOSPAMmath.uwaterloo.ca
Fri Oct 18 18:22:39 EDT 2002


Hi!

	I am wandering why the two output lines in this
program are not the same. I am using Python 2.1.3.

Code:

from re import *

s = """32
34
5433
443 """ 

print findall("([0-9])", s)
print findall("([0-9])", s, MULTILINE)


Output:

['3', '2', '3', '4', '5', '4', '3', '3', '4', '4', '3']
['3', '3', '4', '4', '3']


Claude-Guy



More information about the Python-list mailing list