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 13:40:23 +0200 Message-ID: References: <20210519213207.GD4855@tuxteam.de> <20210520082613.GC1127@tuxteam.de> <20210520095603.GD1127@tuxteam.de> <20210520102244.GE1127@tuxteam.de> <20210520105035.GG1127@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="38835"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 20 13:41:41 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 1ljh3d-0009uH-Ap for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 13:41:41 +0200 Original-Received: from localhost ([::1]:49966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljh3c-0005Hn-Cq for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 07:41:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljh2V-0005Ha-Oz for help-gnu-emacs@gnu.org; Thu, 20 May 2021 07:40:35 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:41909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljh2P-0005Mx-8a for help-gnu-emacs@gnu.org; Thu, 20 May 2021 07:40:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621510823; bh=eqCbf0SaBoXlgPNs7lXTlo6PxSfjDEa2rszSWSkTLeM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=iwGRRYG7Ew2FIjVG0aADK+bZuY7mxY45j3EfzHzlbBl0UEVBHSbRZgm/i0oE3xTHF 4gN3+Fki2jNikT1yuRwHT5Vk6Zp6XnsaMuhIqihqCzJnL5kBXsqWFdJTRwRq039uaH Gpj8b/HKiCZQldMfr60syCzIZbpvXxXO/Iv1MxRw= 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 13:40:23 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:BspP8yrN9VrFB/cAIAgbXo1Cgo3LRd0zDdbVf7GNeETKtddJtWkVB0kvUNpt2nUQ6F+uS A5L/HBio0dBqRdJY1ny8O7EZrsHK0uyb/0E5A/IcjdbtdEoxSEZu27tYYzdXeHIgieropCWmnWsD iN+dY9typZwBJFaGjlWdU9K44L+525UzVNGXjTxgWHEFYPR6bBIYUV4sw5dGviXZMGIZhDfi0W5l FKzz//MoyC0tthy/nBFU6Ty1QHpMDlpaB7di5NwPliM3EruF+UPuYhrPKOcqIIWpl8LTZb+Y32ad TI= X-UI-Out-Filterresults: notjunk:1;V03:K0:TFI/AqCHl8g=:vAMclwNdYOaFzcYcvvHjb4 AcRX0jnC+8e7OtD5cnTmajO4+9i7baJD1S5AHl59BXd0+uoMAjJdC9iS68q9ZNtwW+ndLKrAl Rj/amPb1Nmr/UeRr/TG7e0FksEuobfwJoB5jc8lDsgFYlYyjVxXbHGValRVj/pRTXA0lFiTrx Pdg7G5Xx0vdFmp0IWamhbATlirQZay+Ab6BD9D0Y/05brkcvt2E/yU7OR9n7+KokJDSIsSD6A 2fXNo+FmxIwHXku2vvsDUPWVBt2IUpKE8eyZQV3Q3TE7ks/PkzkcGWngrtwP6d4Bn8PSmRoyp vAr+1eBJDVI3h6nouK71cMOxt8B+P011cEFgoV8wwLxkdegj8t6b0TmXWHuFsMf16Nfgtqaum dHSWvOKMSj3AAp7QTOquJzmkX3MIXwpew2G+vNUFgN6vqEojM+IvY6klhES0GTmPIoN3uXpK3 VYfASL2rv0NyjAodqYAroFf+c2iDrArA7EoAuB9+bqBkjPxQ5g474typY019awb624cIXQV5k UUYct3GHaK3gzC3c4FmSIoYJ94jCftD8ZnpLT7bkRkJl1PesXFsRZPiME2JFbOcq6T84sPsTG r3GgxpDz1Szjzrx3rZDA05ww7uJTBtVxp4S4lwKWaBjYg1PQaIvwqQMMo6YdELFCvvaBlYGrz YgWToj/P/FOjon22uiT6TGzG2srhXTW36qIfOuvlY02Cd9/skeiZ5vb6Uab9W+KhNP5ojmJLG 8NrHW+0wVEmkF9NdlObrv5y6SWONm7U7kHjpXRLVww1tzKRpxk48505aeRpG2makl8mal519 Received-SPF: pass client-ip=212.227.17.20; 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:129963 Archived-At: > Sent: Thursday, May 20, 2021 at 11:31 PM > From: "Christopher Dimech" > To: steve-humphreys@gmx.com > Cc: "help-gnu-emacs@gnu.org" > Subject: [External] : Use the characters "+" and "-" in regular express= ions > > This could be what you need > > (string-match "[\s]+ " s) > > Matches any white-space character. That would actually match a sentence, which I don't want. What I like to match is a string composed only of whitespace. > > Sent: Thursday, May 20, 2021 at 11:19 PM > > From: steve-humphreys@gmx.com > > To: tomas@tuxteam.de > > Cc: "help-gnu-emacs@gnu.org" > > Subject: Re: [External] : Use the characters "+" and "-" in regular e= xpressions > > > > This is a string of blanks, a string composed of whitespace of any len= gth. > > > > " " > > > > > > > > > Sent: Thursday, May 20, 2021 at 10:50 PM > > > From: tomas@tuxteam.de > > > To: steve-humphreys@gmx.com > > > Cc: "help-gnu-emacs@gnu.org" > > > Subject: Re: [External] : Use the characters "+" and "-" in regular= expressions > > > > > > On Thu, May 20, 2021 at 12:37:17PM +0200, steve-humphreys@gmx.com wr= ote: > > > > > > [...] > > > > > > > Done some tests and got some strange results that thought would no= t match. Then things > > > > made more sense after your clarification because when I looked at = some of the strings, > > > > there was a comma in them. > > > > > > OK. Glad I could help. > > > > > > > Am seeing how to match strings of blank lines > > > > > > What is "a string of blank lines"? > > > > > > I know strings of characters. But a line is not a character. > > > > > > Do you mean "several blank lines next to each other"? I don't > > > think so. But what do you mean? > > > > > > > But " +" does not do the job. > > > > > > Again: you know by now that this will match "one or more spaces". Is > > > that for you a "string of blanks" (huh: where did you leave the > > > "line" from above?) or not? > > > > > > > I know why, but how can one match strings of blan= ks? > > > > > > To even have a chance to do that, you'll have to get hold of a more > > > or less precise idea of what "a string of blanks" is. This is work. > > > > > > Begin with: > > > > > > (string-match " +" "A summer full of butterflies") > > > =3D> 1 > > > > > > Bingo: the first run of one-or-more spaces is at the position 1 > > > (the first position in the string is 0, the "A"). So it's working > > > as it should. > > > > > > So what is /your/ idea of "a string of blank lines" or "a string > > > of blanks"? Only you can find out. > > > > > > If you feel you are stuck in that task, it sometimes help to collect > > > a couple of examples and counter-examples (they'll come in handy > > > when you try to test your attempts). > > > > > > Cheers > > > - t > > > > > > > > >