From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: steve-humphreys@gmx.com Newsgroups: gmane.emacs.help Subject: Re: RE: [External] : Use the characters "+" and "-" in regular expressions Date: Thu, 20 May 2021 08:26:39 +0200 Message-ID: References: <20210519213207.GD4855@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40925"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 20 08:28:58 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ljcB0-000AQI-8Q for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 08:28:58 +0200 Original-Received: from localhost ([::1]:51386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljcAx-0002SL-Uw for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 02:28:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljc8y-0001Kv-Ol for help-gnu-emacs@gnu.org; Thu, 20 May 2021 02:26:52 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:41885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljc8w-0008EK-AP for help-gnu-emacs@gnu.org; Thu, 20 May 2021 02:26:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621491999; bh=TEGHX5CcU4bhQqabZ5c5Hc6EgXO+SB3LVJuJyNnCZuM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=ZlyzhrbLG7+sDa3rhRRMxa/UElp/NAujGa7abAB+a3WEuUzmjrL2vWdh+sME2pT+k BCEotwyl7izhZR4B6dSV/4R5nPyEYYYMCKKdA2rEmKuDaTAJorfzN9CT08LssK+CS5 gm6GeZtX6arsH3L5cgouieEOdV/NmN6ztyUGQFZk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs08.server.lan [172.19.170.176]) (via HTTP); Thu, 20 May 2021 08:26:39 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:RUPkeE3m5O0Jy/5jCHyalSMtJaCJW/npuDcvln9wmO6G5A0mfZuctgxM6LkFDP6kioF4y j3UYG5M9aTi3ZmvUY0UArbykRgAfsuNJOZ+0a51Mo+2UGmnqp7U+OCx11D5msnpMB7y9VSvhpTFi gB7g73GgL6YhSxFXfCMwh4bMtFiDSaN1+E666gtJe1khLOZM/77FRhpyxToUOMYqd6jGunrRpgHW 0ApabOuvIuA3snlmJishl1I144wvjQ/8TOQdXc+z7px/E/ClV4FvzQsYnIxuIJE8/C33I09Dxxb4 Fs= X-UI-Out-Filterresults: notjunk:1;V03:K0:vP3WqkVbGTM=:NUT0W/CO0TLJR7+IReNcyA e20s4Lko5F/v4fnVwJx57xnSpMicZkkPWPV9GTHwSzfGnnmYy6vxL3sJoVjFnT9A+hEMfzFoS 7VksJnlfgN+WamMYbX/H6sZ8e3NAZkeTeL5CHKOPbXS6ahlZj+ws7eC8z1Cs42FyKa4IZlcoh QZ4WZVDPDbrSkQdpN0w03+bdyfR53UhuOWzjl2c3GM6s4xH3AML0HDMXCDzZlA8X9Jdphfk+S WoOfncLeEzmekpgClwT+uQLnJX41ORGFk7dAMFXdEY8kaLchpDBHhKuKGQ0VaYVmu0jNThkwc r6YQp03CJOSHZBzQE030+qASbdXjguq6vdpa7tOli4It7w77tvuW577V9tleSty0GqfjjuW5h C/YW6p+eg7ksx9YU5Zvs6mYUOMbSUIsQDNZA3AHRdbHFSS82LDdYwVjPwSL+uZ+G2FsH9D0LJ nqITWTk0CbZHdT/Qf/OxlGgKLlWAdu6zRaHj2ok2aXG6/r+dyuXmqFTkUKlL5dODMDZ/gBYOb LhVvkjGmT4UunYblJTGfxLYxq8vFmn/M7ZeEGZu7K8sf8oI0B6O0D49iQ+5Go8wMv27RCI9mq ChjZo4yq4jbOlY+FHzKpiiZ9LgXg9PiJkiSHAvzG9mLKSIZ7SRzqZ3vnP2LAh+92QAyS/B9zb AhtwFR8FRRbRe8kCBxZizPAOLAFzC5TvaSHsxu/NyYmR/KUHw0CfUEQI3a5wkuxP1L84ohOWa D2I4ZQ0RGV1jnImMzfBrZ90qgBDyDWML/FjubRwsFKPFRXAuSmKzdThLkgfUMd3dm//qbj1m Received-SPF: pass client-ip=212.227.17.21; envelope-from=steve-humphreys@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129947 Archived-At: Have done as follows but cannot see the result=2E Have read through the table of valid format specifications, and the other options are mostly about printing numbers=2E (message " ") (message "*** ***") (setq s (string-match "[+]+" "++++++++++++++++")) message("%s" s) (setq s (string-match "[+-]+" "++++++++++++++++")) message("%s" s) (setq s (string-match "[+-]+" "----------------")) message("%s" s) > Sent: Thursday, May 20, 2021 at 9:59 AM > From: "Drew Adams" > To: "tomas@tuxteam=2Ede" , "help-gnu-emacs@gnu=2Eorg= " > Subject: RE: [External] : Re: Use the characters "+" and "-" in regular = expressions > > > Hm=2E According to the docs, the dash should go last, but=20 > > a test actually confirms that it works in first position=2E >=20 > I quoted this from (elisp) `Regexp Special': >=20 > To include a =E2=80=98-=E2=80=99, write =E2=80=98-=E2=80=99 as the fi= rst or last > ^^^^^^^^^^^^^ > character of the character alternative, or as the > upper bound of a range=2E Thus, =E2=80=98[]-]=E2=80=99 matches both > =E2=80=98]=E2=80=99 and =E2=80=98-=E2=80=99=2E >=20 > That's from Emacs 26 (and all prior releases, at least > as far back as Emacs 20)=2E But yes, they changed that > text for Emacs 27, to this: >=20 > To include =E2=80=98-=E2=80=99, put it at the end=2E > ^^^^^^^^^^ > ___ >=20 > For Emacs 20, it says this: >=20 > To include a `-', write `-' as the first or last > character of the character alternative, or put it > after a range=2E Thus, `[]-]' matches both `]' and > `-'=2E >