'\.' # NOT a valid escape sequence in **regular** Python single-quoted strings
"\." # NOT a valid escape sequence in **regular** Python double-quoted strings
他们会发出这样的警告:
无效转义序列 \.
然而,所有这些都是允许的,并且是等价的:
# Use a DOUBLE BACK-SLASH in Python _regular_ strings
'\\.' # **regular** Python single-quoted string
"\\." # **regular** Python double-quoted string
# Use a SINGLE BACK-SLASH in Python _raw_ strings
r'\.' # Python single-quoted **raw** string
r"\." # Python double-quoted **raw** string