Sujet : Re: Correct syntax for pathological re.search()
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 08. Oct 2024, 20:32:04
Autres entêtes
Organisation : Stefan Ram
Message-ID : <backslashes-20241008203026@ram.dialup.fu-berlin.de>
References : 1 2 3
MRAB <
python@mrabarnett.plus.com> wrote or quoted:
However, regex also uses backslash as an escape character.
TeX also uses the backslash as an escape character:
\chardef \ = '\
, the regular expression to search exactly this:
\chardef \\ = '\\
, and the Python string literal for that regular expression:
"\\chardef \\\\ = '\\\\".
. Must be a reason Markdown started to use the backtick!