\t is not equivalent to
\s+ should match a tab (
The problem in your example is that the second pattern
\s\s+ is looking for two or more whitespace characters, and
\t is only one whitespace character.
Here are some examples that should help you understand:
>>> result = re.match(r'\s\s+', '\t') >>> print result None >>> result = re.match(r'\s\s+', '\t\t') >>> print result <_sre.SRE_Match object at 0x10ff228b8>
\s\s+ would also match
' \n \t \t\n'.
\s\s* is equivalent to
\s+. Both will match one or more whitespace characters.