May-09-2024, 01:12 PM
(May-09-2024, 12:16 PM)deanhystad Wrote: \. Is not an escape sequence. \n is an escape sequence. A backslash by itself does not mean there is an escape sequence. The next character has to be n, b, t, x or backslash for it to be an escape sequence. I may have missed an escape character in that list which is why I use raw strings any time I write regex patterns.
Thanks for the quick answer guys.
\. is not an escape sequence? If I want to search for a literal "." I have to escape it with "\.", am I wrong? The same that for "\n", if I want to search for a literal "\n" I have to escape it with ''\\n" or r'\n".
Sorry if you find this as a very basic question, I just find it very confusing.