Path: ...!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: 13 Oct 2024 10:45:44 GMT Organization: Stefan Ram Lines: 23 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 0lP9m+E/HqB/epv2WPsU9A18mXH86Y40a9HI/w5mkLe3HX Cancel-Lock: sha1:YGMngTt1ISUdhtqGHVcqMD33JbM= sha256:ChYHgvQqeKTM/1m7turJ6fCg7wKTKuD7PP6kNzit88g= 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: 2067 Gilmeh Serda wrote or quoted: >You don't need to escape the curly braces. Here's the 411 on some gnarly regex characters: .. matches any single character, except when it hits a new line ^ kicks things off at the start of the sequence $ wraps it up at the end * goes zero to infinity + one or more times ? maybe once, maybe not { starts a specific count, like {2} or {2,3} } ends such a count | either this or that \ flips the script on the next character's meaning ( drops in on a group ) bails out of the group [ paddles out to a character class ] rides the character class to shore .