Hello,
I'm trying to use re.compile() but got error message: "Cannot import attribute within module compile. ".
My code is pretty simple like the following, which works in Spyder:
Does anyone know why?
Thanks. -Wei
import re
pattern=re.compile('ab*')
string='abcd'
check=pattern.match(string)
if check:
print 'Yes'
else:
print 'No'