In your re it should be \.
not \\.
.
In Python an r
outside a string makes a raw string literal. The benefit of raw string literals is that backslashes (\
) are not special to Python, which means it's easier to pass through to re
where they are special.
In both lines you are using raw string literals (good!), so the \b
is specifying a word boundary. However, the \\.
is looking for a \
followed by any character. What you want is \.
which is a literal .
.