From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: RE: [External] : Regexp for matching (defun lines Date: Thu, 01 Aug 2024 04:15:43 +0000 Message-ID: References: <5kzhsBHCj8GW4rjzi0sutBSutYlMHmDBIV7PD1V_v0CGB-KH5pSJPw0jrwHErO5ivHjsPTAcmmaAHXNJH4u6VON3xL6q7Hdwnf2SNxOw_G8=@protonmail.com> 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="14935"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "'Help-Gnu-Emacs (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 Aug 01 06:16:35 2024 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 1sZNEw-0003j5-Fx for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 01 Aug 2024 06:16:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZNEJ-0007VN-Dx; Thu, 01 Aug 2024 00:15:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZNEH-0007Uy-Iv for help-gnu-emacs@gnu.org; Thu, 01 Aug 2024 00:15:53 -0400 Original-Received: from mail-40140.protonmail.ch ([185.70.40.140]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZNEF-0007tO-Df for help-gnu-emacs@gnu.org; Thu, 01 Aug 2024 00:15:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722485747; x=1722744947; bh=NJoUdBiyuHUrEa7JEv/n5rM5TKDGnxCDOF5d7Xk9mYw=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=A3jyakkj5oHbgoDS+7VlNFBze0Uu2E9A4Q0uS8ZApb9TgF1LqJTtIDcouN3ISW4bF i2eMZ/3SXOHfNp5QwI4qdG+GZ+hzT2LKR51TkMawZb1BQIiZqUBGxumBw/gw1B8buH I+YAd178v/8QCLDxfB3xcOMunME1JkBXwFq/4AZ/zSTPFwyK5nbPJGPcnBfT7unupm TM7AcSHRiDV7IV/qvjfOO9b64YPQO+cmdyiPfRJ+Qtm0Ne/y0UYCVJVugGhP6sYcDB +LC9jxBPl60Nj0hm/snCPiQucSV1Fyp6b7TPKnZExl0ckRjUuTnbOluLxgNV6M6Zsd d6B3JTw31i+2g== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 8e68004aea40906f139c6e6f7cad0e7d93478c68 Received-SPF: pass client-ip=185.70.40.140; envelope-from=heimeborgia@protonmail.com; helo=mail-40140.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147478 Archived-At: Sent with Proton Mail secure email. On Thursday, August 1st, 2024 at 3:34 PM, Drew Adams wrote: > > > > > > > (concat > > > > > > > "^\\s-(" > > > > > > > (regexp-opt...) > > > > > > > t) > > > > > > > "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)") > > > > > >=20 > > > > > > I see that you use "\\sw". What is the advantage verses > > > > > > "[[:alnum:]- > > > > > > _]" > > > > >=20 > > > > > No special advantage. You can include any other > > > > > chars you want, so you can pick up, e.g., > > > > >=20 > > > > > (defun foo!@$%^&*+=3D{}/:42<>? () > > > > > (message "Hello")) > > > > >=20 > > > > > Perfectly legitimate, and none of those chars > > > > > even require escaping. > > > >=20 > > > > Meaning that \\sw is superior to [[:alnum:]-_], right ? > > >=20 > > > No. > > >=20 > > > \\sw means word-char syntax. > > > [[:alnum:]-_] means alphanumeric- or symbol-char syntax. > >=20 > > \sw is equivalent to "[:word:]", that includes digits. And [:alnum:] > > is alphabetic and numeric. What is the difference ? >=20 >=20 > https://www.gnu.org/software/emacs/manual/html_node/elisp/Char-Classes.ht= ml >=20 > says: >=20 > =E2=80=98[:alnum:]=E2=80=99 > This matches any letter or digit. For multibyte characters, it > matches characters whose Unicode =E2=80=98general-category=E2=80=99 prope= rty (*note > Character Properties::) indicates they are alphabetic or decimal > number characters. > The same is not said for [:word:]. I thought that alphabetic and words constitute the same characters. [:word:] also matches accented letter (e.g., in French, Spanish, Icelandic)= . It is difficult to know what is actually defined these days.