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: [External] : Use the characters "+" and "-" in regular expressions Date: Thu, 20 May 2021 09:59:59 +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="5944"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: steve-humphreys@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 20 10:16:01 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 1ljdqb-0001Hj-FN for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 10:16:01 +0200 Original-Received: from localhost ([::1]:34324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljdqZ-0005Sr-LS for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 04:15:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljdbD-00089i-QC for help-gnu-emacs@gnu.org; Thu, 20 May 2021 04:00:07 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:41709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljdbB-0002Dl-Hb for help-gnu-emacs@gnu.org; Thu, 20 May 2021 04:00:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621497599; bh=B5fs4n8eyDzn+fQZ1MYreNTVdJjILdu1jCY8yKnFWrw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=AfNLlNruFgLHaYU9U3AsyyIjDU7UaC//xdQouYRQt0vNPGiYhMgaNx7TzTw5RPGhS xJXehAf7xEoO8Ejlv85XElD/Tqjs6Zh92frfWjB/C549rtyhEVDlJgoy/40W46pVxh M9TmNYKQ1SfBIPxi+9WT15l9wNMGrYLhOlLlJw/c= 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-bs16.server.lan [172.19.170.184]) (via HTTP); Thu, 20 May 2021 09:59:59 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:NxqygGW7v8Lu1fWen2kt6q/wBjVB06S/kx24vNAHT31/d6B6dZSnKCPn+rv7F+TZzoD1a NO4mPlRtaE3uDCUNBHVGO9rnnFLHCoAY0g1TPVbsiJ6DeDlmCLPQJ4VHrlV36xBPjyr9VFBGdViz /thX5ji8dg91EATvWb4AiSkozhJ9SnZo0w+XYaPAiywCfY55F1yc4/K+c7/gIWgnnkCc0OJBZXTu gUlshl0y1NDlqL+YN42U9CEfygHXhYB1pEDXm8kKJCcb0C3W+t8VRmbAfEJN3leaUb2p1KZT5FX5 zQ= X-UI-Out-Filterresults: notjunk:1;V03:K0:iaIlSUChvnQ=:cx4ZOTfxW3EpZdjGKfooGa DlcZTUJGszm4V9V5T3AiLzvLqTZ7sETOCewnQE5Lh2RAQC1uwtIlGZX4JsfSWQZ+BTdmf7ai2 1TQ6TUhtf8yYLkIPhoAXhHXgp5Ykst/ryz35sG+32T7TMZa7yu9mgi8OUTCD0hf4hch18K11A QOfQ18AE3/kQXWRe1TayYeDBJxIC4Ak7p7oXRRtEvY8k1/cKchXKZvRIyX9xhPIpgUt0W7bMb EqcZIDPncNzWKsbqPFhe0ntG/Tx1YF5h8GxX2I9hkPzmHVo4rNw1JY3o04DvoX0/fF/4WE221 xI5jC4nDdsS6JGoa5IjMjTNduF5jGtAO1X8GjPnUKiowNSqJV1QSD82yEgYxatGyI2LzgpUvW dHQVuBERFqGl/6iDaVw/jJnCxetvief8RrF1b2yiokIT4ehbmwCor9rTSaNwrVkLKp8JcZs6p pX/1oiR8hu2SJtQJIcSithKdzlMLGuDGuf3MxvkxgQein7Cf6pB21xz71EBCIMF40I/aAKY3M hpHYKN4N2yF7ZEKstAJGzfi/q9N9KTGCHiTb10O90atGPuh/h3ll31/B9BimKPNDQB0/hAco3 UVj2TMTowllkz7JDOVVw/k1rXj1EPh5v3tiXvBCBzopqqIGRfCUu1Ytv66WoiSBl28tjO8ENE Ca6ePCyncFoN9YETdZ0l+JLc4dd5+oH3es+WIgUzj0MwWkkYP9FnuSq9yAn8YXfmunVysF9lP u5AbS1kBeaw0xyEj2msoaFeMdp8sQ9bCgGjPwyrK5llg4qzudfWmD7qGmPaauNWkYAcIOsHy 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, RCVD_IN_MSPIKE_H2=-0.001, 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:129950 Archived-At: I wonder why I am getting=20 Symbol's value as variable is void: message (message " ") (message "*** ***") (setq s (string-match "[+]+" "++++++++++++++++")) message("%s" s) (setq s (string-match "[+-]+" "++++++++++++++++")) message("%s" s) (setq s (string-match "[+-]+" "----------------")) message("%s" s) =20 >=20 >=20 >=20 >=20 >=20 > > Sent: Thursday, May 20, 2021 at 9:59 AM > > From: "Drew Adams" > > To: "tomas@tuxteam=2Ede" , "help-gnu-emacs@gnu=2Eo= rg" > > Subject: RE: [External] : Re: Use the characters "+" and "-" in regula= r 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 = first or last > > ^^^^^^^^^^^^^ > > character of the character alternative, or as the > > upper bound of a range=2E Thus, =E2=80=98[]-]=E2=80=99 matches bot= h > > =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 > > >=20 >