From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.emacs.tangents Subject: Re: Negating a regexp Date: Thu, 20 May 2021 12:39:17 +0200 Message-ID: <20210520103917.GF1127@tuxteam.de> References: <20210519213207.GD4855@tuxteam.de> <20210520082613.GC1127@tuxteam.de> <20210520095603.GD1127@tuxteam.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SnV5plBeK2Ge1I9g" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40868"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: emacs-tangents@gnu.org, steve-humphreys@gmx.com To: Yuri Khan Original-X-From: emacs-tangents-bounces+get-emacs-tangents=m.gmane-mx.org@gnu.org Thu May 20 13:05:57 2021 Return-path: Envelope-to: get-emacs-tangents@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljgV2-000APx-5h for get-emacs-tangents@m.gmane-mx.org; Thu, 20 May 2021 13:05:56 +0200 Original-Received: from localhost ([::1]:55518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljgV1-0002ze-74 for get-emacs-tangents@m.gmane-mx.org; Thu, 20 May 2021 07:05:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljg5S-0002O9-B8 for emacs-tangents@gnu.org; Thu, 20 May 2021 06:39:34 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:37829) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1ljg5O-0002qY-OU for emacs-tangents@gnu.org; Thu, 20 May 2021 06:39:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=BXKv67mn1aFGQ5T0iSXGFGrHdLjjjYB/uyaBJ+ke9FY=; b=aMuQ122wAjMQPs36Cte9hAFIJX6RNbT27UxXBEkUq5IJqA13+Vy+p2lb5f8I8hPB6i3gHoMKAOm9Xe7lltMNRDuaKwzALQg3HWnmgm8c/hwpniP0bk5dh+wYrdCVydJKBuVjILUnipgYNF5KHbwe3WTPKJfx7rxitz++jBZ6hWGu1+lyCgMK4fMk111k6Xv1lwNLxQ4rV9dACKfaJDbx/d3xV57Sviy2acrVZodNRO6Dwmfxj0jEe92B8Y/uoVb+/ChDGu1on00UDuqTUaVL0VVfj5qZRQwR+5j1dK6MtCIfuMaGZRMZMKmNoEjbWcIWAeiU8YI7eXa6Ah73BnkN5g==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1ljg5F-000318-GU; Thu, 20 May 2021 12:39:17 +0200 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 20 May 2021 07:05:42 -0400 X-BeenThere: emacs-tangents@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Emacs news and miscellaneous discussions outside the scope of other Emacs mailing lists List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-tangents-bounces+get-emacs-tangents=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-tangents" Xref: news.gmane.io gmane.emacs.tangents:640 Archived-At: --SnV5plBeK2Ge1I9g Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 20, 2021 at 05:29:50PM +0700, Yuri Khan wrote: > > > How could I negate the regexp that I have defined? > > > > I don't even know what you mean by "negating a regexp". >=20 > The automata theory, where the notion of a regexp comes from, defines > a =E2=80=9Cregular set=E2=80=9D [...] A beautiful theory, indeed. In that context, "negation" has a definite meaning (but, as you wrote: anchoring, yadda, yadda). I'm almost sure this is *not* what steve-humphreys had in mind (but hey, I've been wrong before [1]!). > So, to steve-humphreys: There is no practical general way to negate a > regexp. You need to either negate the result of attempting to match, > or to think hard and write a new regexp that matches what you want. Exactly. I think that, to get some help here, steve will have to refine his idea a bit for us to have a chance of making some sense of it. Cheers [1] This is, as you might suspect, a shameless understatement :) -- t --SnV5plBeK2Ge1I9g Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmCmPFUACgkQBcgs9XrR2kbgvACeOxrRfQ0m63nZlADR5my0XO9q vJoAn0TXAwU2vizZvwihlAeh5rU3KLuy =RZyW -----END PGP SIGNATURE----- --SnV5plBeK2Ge1I9g--