From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: [External] : Use the characters "+" and "-" in regular expressions Date: Thu, 20 May 2021 13:49: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="1107"; 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 13:49:50 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 1ljhBV-000Aaw-7o for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 13:49:49 +0200 Original-Received: from localhost ([::1]:56038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljhBU-0001cq-9u for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 07:49:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljhB9-0001cU-TF for help-gnu-emacs@gnu.org; Thu, 20 May 2021 07:49:27 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:53539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljhB7-0002gs-U5 for help-gnu-emacs@gnu.org; Thu, 20 May 2021 07:49:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621511363; bh=XbH9bP1AAIS9hBH9eACJjUmHcop+LMJffPquZ2WW6WE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=E+Z+R4SeVoTv/A7DrGpmFSWiEYLRVeprCw/EYgNNwSpAvsy7j5xiQWkFRRhP8KaUl NdHvZlqxE4+VS2/afuSHsdAsak8kxTQl6FDcfg0VyqBe7asYIrkttGbyliqm8b+Vqk dBcsuAi6hkVIhdewSc4CzXG7x1lkLDyXGxKxkgLU= 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:49:23 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:seoDIG+MqlJ+zramXrOw33EGy9Q6sNFM/3bQTwOeIgdvjaGNxC5RcKUsORFJ5h0uH1JIc isONlxxj+S4fpaGpAy+DzV3K0t6v01paOUj/lmFpUfv940NFkkdzuuWewrokkfZESXsTrDD5TGs5 VsWDVoU2E2YnLYWmL/z42hzdFRiQlxFqKvYr3XtIgZ/NndP3HMWid8L2nlDmTqQbWy0lHVN4Rl20 Gz1ZwbGZoZ3HcgbrHDVa3qKqez3ndPeomwtMu5xMADd1B0KAPxFcwcrlUk2Al19ZsZlANJOUHsnC dA= X-UI-Out-Filterresults: notjunk:1;V03:K0:c2QCP4ChgJM=:e2I+HA9ySfBlNUuzLztHlK 6b/mnWe/pfNc6r/qGxuH0BztCbZvsLG37LJCTwLzLothUerhXJrWbWw1kTjnCQdLY1Jj/3BbE sDzaE5TkeetaNdqQhb/jWmVSyQgdPi9D+fIuIs0sYZxRTsxdNTx2T2YJ3/heesSole72LpdxK K7IKjjsfj8jyzcQVgu2IrclpxzKaF2KOKb/zfY+KgFTYbnmxXheGpx1LOZWpfs/jGwlS6M/va YwcdAZOfsCQdf9LPMy9EXbi25vHaemc2QAjUa+8t516udL9gHSYlkkvrvahTu3oo8zOJ27Yr8 v6moNCFDpEZOy1aufJr+AKNngAP/EXjkOoYMyyvFG/D/4qvR+rNjc7LavwSbowvw9JtHdhBOz YEREMomc3P6QYBYM5RSeRuWji7noz2HW2Nf8clIVZSVar9Ejc8wohm0W3PF794S6hrVT1IMnw zJS0NRQi/PV/4X5D7dmm1QQ2CXgyyBgN2B8yImf9vM5LY9HoG6SEdkhw6tffi+1Dc/ci4G89i cyjElBpByeZWQ0VTfiOr23fs5cdUIVQ9oIjHcWwTBY2FGDL3bK6QKXo+9v0BlixwCdLJmqAej 04OQ7Q2aUxNv3ZYCUpLN+1PVDvn9U5buOy8y9LB2Jnsgv7j05Km572a2w1mDErqY7i8vgSDJy Jl2l6KiEBldHwFOzxrtxXc6zAz1AI1p3Sqvc5YEafJUi3gPFKWifnl0Sdl3Ie2p0ukIHYOjwh QimjilGN1xy2W7Lg65BQRP8ZF66l3mHnVSEbgmfjwKA3R1Q4L6CducPOLnScCayxqX62j1Pd Received-SPF: pass client-ip=212.227.17.21; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:129964 Archived-At: Try this one instead, which should match strings containing 0 or more whit= espace characters. (string-match "^[\s]*$" s) > Sent: Thursday, May 20, 2021 at 11:40 PM > From: steve-humphreys@gmx.com > To: "Christopher Dimech" > Cc: "help-gnu-emacs@gnu.org" > Subject: [External] : Use the characters "+" and "-" in regular express= ions > > > > > 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 expre= ssions > > > > 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= expressions > > > > > > This is a string of blanks, a string composed of whitespace of any l= ength. > > > > > > " " > > > > > > > > > > > > > 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 regul= ar expressions > > > > > > > > On Thu, May 20, 2021 at 12:37:17PM +0200, steve-humphreys@gmx.com = wrote: > > > > > > > > [...] > > > > > > > > > Done some tests and got some strange results that thought would = not match. Then things > > > > > made more sense after your clarification because when I looked a= t 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 bl= anks? > > > > > > > > To even have a chance to do that, you'll have to get hold of a mor= e > > > > 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 colle= ct > > > > a couple of examples and counter-examples (they'll come in handy > > > > when you try to test your attempts). > > > > > > > > Cheers > > > > - t > > > > > > > > > > > > > > > >