Is it !-\ (characters from 33=ord(‘!’) to 92=ord(‘\’)
and ‘.’ and ‘&’ in a set?
I think my interpretation is incorrect based on my test.
But python reference doesn’t say anything wrong with my interpretation.
http://docs.python.org/library/re.html
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In short,
r'[!-\.&]'is just a complicated form of writingr'[!-.]'.It matches all characters with
ordbetween33 = ord('!')and46 = ord('.'), i.e. any of the following:The escaping backslash before
.is ignored in character classes; it is unnecessary (.matching all characters in a character class wouldn’t make any sense). Since the ampersand&is already in the character class, it is superfluous as well.