From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Regexp linting scan Date: Thu, 5 Dec 2019 13:11:58 +0100 Message-ID: <68EA74A2-F64C-46BC-8FCA-FEB41BA9DD2E@acm.org> References: <877e3bldz4.fsf@md5i.com> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="257193"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Richard Copley , Paul Eggert , Emacs developers To: Michael Welsh Duggan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 05 14:42:51 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1icrP8-0014l9-Ce for ged-emacs-devel@m.gmane.org; Thu, 05 Dec 2019 14:42:50 +0100 Original-Received: from localhost ([::1]:54254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icrP6-0002Zy-C0 for ged-emacs-devel@m.gmane.org; Thu, 05 Dec 2019 08:42:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53254) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icrMi-0000BJ-Ql for emacs-devel@gnu.org; Thu, 05 Dec 2019 08:40:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icrMf-0006Ua-VA for emacs-devel@gnu.org; Thu, 05 Dec 2019 08:40:20 -0500 Original-Received: from mail204c50.megamailservers.eu ([91.136.10.214]:57416 helo=mail193c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1icrMe-0006KR-7u for emacs-devel@gnu.org; Thu, 05 Dec 2019 08:40:17 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1575547922; bh=iIDxp8su2+b7a7Cejpu21y5ORdWU2+ErY6hbdWvVycc=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=g0XDF4zlCQgsesfCSeeM14w60NbnbWAPvzJ/LLftgkH1rF+qDh97oHGJ7k1xpeL7N v68C5g/o6c9Xajn3XqXp5/j8MnTnnayGYTPCyU/H3c7rNtGQKX9yOhH62qJCZ5ikcO u3A1o0hoi/8b7I+hlM4JQQksWPwX2nk7Lwbs/LCI= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-6f4fe655.032-75-73746f71.bbcust.telenor.se [85.230.79.111]) (authenticated bits=0) by mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id xB5CBwMW000329; Thu, 5 Dec 2019 12:12:00 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B020C.5DE8F412.003D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=SamJicZu c=1 sm=1 tr=0 a=fHaj9vQUQVKQ4sUldAaXuQ==:117 a=fHaj9vQUQVKQ4sUldAaXuQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=N54-gffFAAAA:8 a=xjA3aGymAAAA:8 a=w1ohPxqBJXtF2HKy8ScA:9 a=QEXdDO2ut3YA:10 a=6l0D2HzqY3Epnrm8mE3f:22 a=q6cpOQRajkITsuviW4gi:22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.136.10.214 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243149 Archived-At: 5 dec. 2019 kl. 12.38 skrev Mattias Engdeg=C3=A5rd : >=20 > 5 dec. 2019 kl. 03.10 skrev Michael Welsh Duggan : >=20 >>> - (while (verilog-re-search-forward-quick "\\.\\s = *\\([a-zA-Z0-9`_$]+\\)*\\s *(\\s *\\1\\s *)\\s *" end-pt t) >>> + (while (verilog-re-search-forward-quick "\\.\\s = *\\([a-zA-Z0-9`_$]+\\)?\\s *(\\s *\\1\\s *)\\s *" end-pt t) >>=20 >> Similarly, in this one I think you could also replace the `+' with a = `*' >> and leave out the `?'. >=20 > Group 1 is used in a backref, which only matches if the group matched. = With your change, the regexp would match ".()", which isn't matched at = present. Correction: the '?' can be removed (keeping the '+') since the \1 is = matched unconditionally.