raw string
A string literal prefixed with r, in which backslashes are kept as ordinary characters instead of starting escape sequences.
In more detail
Raw strings are the usual way to write regular expressions, r"\d+", and Windows paths, r"C:\new\data". A raw string cannot end with a single backslash.
Related terms
- escape sequence — A backslash followed by a character that together stand for something hard to type directly, such as \n for a line break.
- regular expression — A pattern language for matching text, where characters such as ., *, ^ and $ have special meanings.
Taught in
- A Standard Library Tour — Hands-on Python: Complete Video Course & Book
- Strings: Escapes, Slices And Methods — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Characters As Numbers — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Strings Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep