From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jari Aalto Newsgroups: gmane.emacs.bugs Subject: bug#7227: re-search-forward goes infinite loop with dash inside [] Date: Sat, 16 Oct 2010 16:42:00 +0300 Organization: Private Message-ID: <87eibqp847.fsf_-_@picasso.cante.net> References: <1213200935.4147.62.camel@cyberelk.elk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1287238837 2270 80.91.229.12 (16 Oct 2010 14:20:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 16 Oct 2010 14:20:37 +0000 (UTC) Cc: Andreas Schwab To: 7227@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 16 16:20:36 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P77ch-0001Z2-VP for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Oct 2010 16:20:36 +0200 Original-Received: from localhost ([127.0.0.1]:45218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P77ch-0004a4-Ci for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Oct 2010 10:20:35 -0400 Original-Received: from [140.186.70.92] (port=48483 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P77VD-0001xp-3h for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2010 10:13:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P77Ul-0005Hq-23 for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2010 10:12:47 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P77Uk-0005HJ-Vx for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2010 10:12:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1P76yU-0008TK-4H; Sat, 16 Oct 2010 09:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jari Aalto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Oct 2010 13:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7227 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7227-submit@debbugs.gnu.org id=B7227.128723631032552 (code B ref 7227); Sat, 16 Oct 2010 13:39:02 +0000 Original-Received: (at 7227) by debbugs.gnu.org; 16 Oct 2010 13:38:30 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P76xx-0008Sz-BN for submit@debbugs.gnu.org; Sat, 16 Oct 2010 09:38:29 -0400 Original-Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P76xv-0008Sr-79 for 7227@debbugs.gnu.org; Sat, 16 Oct 2010 09:38:28 -0400 Original-Received: from saunalahti-vams (vs3-11.mail.saunalahti.fi [62.142.5.95]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id ECE2118D01B; Sat, 16 Oct 2010 16:42:03 +0300 (EEST) Original-Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-11.mail.saunalahti.fi ([62.142.5.95]) with SMTP (gateway) id A070CEEA3F9; Sat, 16 Oct 2010 16:42:03 +0300 Original-Received: from picasso.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id CFF6C4030; Sat, 16 Oct 2010 16:42:00 +0300 (EEST) Original-References: In-Reply-To: <1213200935.4147.62.camel@cyberelk.elk> (Tim Waugh's message of "Wed, 11 Jun 2008 17:15:35 +0100") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) X-Antivirus: VAMS X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 16 Oct 2010 09:39:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:40925 Archived-At: Andreas Schwab writes: > Jari Aalto writes: > >> Executing the following code causes Emacs to go into infinite loop. >> Simply run it behind the last paren with C-x C-e >> >> (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") > > Works fine here. Hm. The test case needs adjustment: ;; (1) Run C-x C-e, works: (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") row2 1234 rest of line ;; (2) but C-x C-e below causes a loop (re-search-forward "^\\([a-z0-9.-]+\\)+[ \t]+\\([0-9]+\\) +\\([a-z].*\\)") ------------------------------------------------------------------------ row2 1234 rest of line > Note that nested repetitions like \([...]+\)+ are bad in any case. This was only a test. The anchor "^" should help, and I assume the first '[a-z0-9.-]+' should be greedy, so it shouldn't take that long to resolve. Jari