+ 2

Why there is no r before the "...." string?

Doesnt it mean that if it is not a raw string then its just a simple string with 4 dots?

5th Aug 2016, 6:05 AM
Kirill Pykhtin
Kirill Pykhtin - avatar
1 ответ
+ 4
Special characters like \n or escaping characters are not intepreted in a raw string. In a normal string, "\n" would be a character on its own and indicates a new line. In a raw string however, r"\n" will be interpreted as a two character string, \ and n being separate characters with no special meaning. That being said, even if a regex pattern is not a raw string, it can still be used if the characters have no special interpretation.
5th Aug 2016, 9:29 AM
Gershon Fosu
Gershon Fosu - avatar