I am curious why the following deduces that there was a coincidence:
import re
foo = 'test\n'
match = re.search('^\w+$', foo)
if match == None:
print "It did not match"
else:
print "Match!"
A new line before the end of the line, yes? Why is this mapping?
source
share