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:31:22 +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="32237"; 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:32:43 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 1ljguw-000853-2v for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 13:32:42 +0200 Original-Received: from localhost ([::1]:45820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljguu-00023Y-SK for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 07:32:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljgtq-00022M-Lm for help-gnu-emacs@gnu.org; Thu, 20 May 2021 07:31:38 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:36101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljgto-0008C9-P0 for help-gnu-emacs@gnu.org; Thu, 20 May 2021 07:31:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621510282; bh=qElJKz1plVSlzFpMfjCYVEOreFFVGWIYDPwxvYuNPjA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Usel7AQCCu4TVpeXWiuSeSvYeuhDuUPTKSazPQ+9rc1oSF9zyya+9mbqmMENkvM0u /zzABvElejnac7hcliPBV6KihwsO+JAoN3eK5C3QFgr6U5d3EmclXqUTV9KSMaFqCw pcpumv+uepv1k2keuR21GpgYBEpBLiSRwLX1FjvE= 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:31:22 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:xc5d95ydjVZzQVoWvDHrQeQU6Hfx/QqFWpki4f2gSA+dAZaFzgRlqyEyIwjQPDz1jL5oy pCyk7SrmW483dZU5KNUuyEw+wBIn/JpWLFIQ/cHKhG+8+hRchcMNzmRtD77CO3+/v0nEhyPMHigQ 8U3i+uWDOAF4GVNkNadWCXVzuRZX66X8nOByU9nF9I7JH7twp9QNh09BSeuoFoW5oFM+lcC42xaE N1Ex7QROH40oiBEK9j55WrcMfrB00+UNn+mv8Eij2sxAGMVwkn9xtc8jEAPecXlA2CG/tjd0/Y0T 4U= X-UI-Out-Filterresults: notjunk:1;V03:K0:TOQ3G5q9V1w=:1WvQqdWUW/BQ/4LDf4kwWX VRRFYYCNsldBJKzqqJDHAXQtkJMoE3ng1HZWu+0/f8TpnjhpNDrnjgQQAOmP44/S1POMXCqGb nYxDU2vooAhXIp7V6Xf/Wj7DeIw/nnYCZ1ibVDorjVejW+66QmWfNSsBpq5zw4SUd38km7C66 2XyZEZ1WgAjWmVG1aS7wTYkqN4pPzk/5z914GVyiNqU7pA3ykPsNBOR/G6+4le0RCIOseapFo Ex+ID58CuHXyL9hu12pSJLLLNg6JDvN7TCCjsGIWekmoDTvSF45Gvr2XXHQsoySzNYpaq2Qqh rFn4ilHaLKJnNQPf0jmaBOA14wcQOSq5lvRLxn3Jswfi7bkC4y2SoPKN5lJhcCsPxUXEXGc5G 2t2XKvK7Td9lYHYbLbjck5/t3kJheHFR59FsdduO3CrNi2vnG/LGU0P8dfQVhsJGD6HQxPh+V zPJF6eBQOrrW7tmPkQrn+Tdd2RbCOkMmPC7WQ0XJEsbvlN+fE0k6eWgbWgcuxSNs2MX6DJY/P L5S14v6anF0yn4ylsqdEndlAJ69fGBgnuv36DHCq1ha/6t6dFIY9zT7Tav+fUakr6CsRwOlWt XXIV599SGD1ZijQitjTMhTDdjBl6Qm0D/HKHKzD6eaWmuzNE2YA6/P7E/n4UlHUSFN002GP2U 2UqbKTEWkAHZun47b+N2Ma3+27rxEoqbGp/VWM4kGMIYsLHH9fDrFr+AbZ8if9+9fSCzBUvNv LPbpcPhFy1Gg1fC4Aic5zxR9/VfDZVQxoENnpivyeijGTEUDG91epUOWW6ABLIbTv8sNOYrV Received-SPF: pass client-ip=212.227.17.22; 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:129961 Archived-At: This could be what you need (string-match "[\s]+ " s) Matches any white-space character. > 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 exp= ressions > > This is a string of blanks, a string composed of whitespace of any lengt= h. > > " " > > > > > 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 e= xpressions > > > > On Thu, May 20, 2021 at 12:37:17PM +0200, steve-humphreys@gmx.com wrot= e: > > > > [...] > > > > > 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 at so= me 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 blanks= ? > > > > 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 > > > >