Because your input string has no digit. \d means capture a digit.
If you want to capture a literal \d, you should use \\d pattern.
See example here.
This program
import re
p = re.compile(ur'\\d')
test_str = u"ca\d"
print re.search(p, test_str).group(0)
Will output \d.
As for r'', please check this re documentation:
The solution is to use Python’s raw string notation for regular
expression patterns; backslashes are not handled in any special way in
a string literal prefixed with 'r'. So r"\n" is a two-character string
containing '\' and 'n', while "\n" is a one-character string
containing a newline. Usually patterns will be expressed in Python
code using this raw string notation.
It does not mean it does not process slashes anyhow, this just lets you use a single slash instead of a doubled one. The slash is meaningful before d in a regular expression.
And as for \a, there is no such a regex metacharacter, so \ is treated as a literal.