Hi,

On a tutorial it says that '\s': Matches whitespace. Equivalent to [\t\n\r\f].

I test it with:

>>> re.match(r'\s*\d\d*$', '   111')
<_sre.SRE_Match object at 0x03642BB8>
>>> re.match(r'\t\n\r\f*\d\d*$', '   111')    # fails
>>> re.match(r'[\t\n\r\f]*\d\d*$', '   111') # fails
>>> re.match(r'[\t\n\r\f]\d\d*$', '   111') # fails
>>> re.match(r'[\t\n\r\f]*$', '   111') # fails

What is wrong in above script? Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to