Path: ...!feeds.phibee-telecom.net!news.mixmin.net!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: ram@zedat.fu-berlin.de (Stefan Ram) Newsgroups: comp.lang.python Subject: Re: Correct syntax for pathological re.search() Date: 8 Oct 2024 19:32:04 GMT Organization: Stefan Ram Lines: 18 Expires: 1 Jul 2025 11:59:58 GMT Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de vnKDXBCzZ4QJSqzm20z33A1T5LSLHwdL4bxF/MidnjiHVC Cancel-Lock: sha1:+hk7RMk6YB2hZpt8eAGR7CdhM+0= sha256:w3ibQX23dsRZNmgY7EHLCfhCeAqMZPhjnK7pa/B58vo= X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change URIs of this article into links, and to transfer the body without this notice, but quotations of parts in other Usenet posts are allowed. X-No-Archive: Yes Archive: no X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some services to mirror the article in the web. But the article may be kept on a Usenet archive server with only NNTP access. X-No-Html: yes Content-Language: en-US Bytes: 1956 MRAB 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!