From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Regex is not being as "hungry" as it is supposed to Date: Fri, 06 Aug 2010 08:29:37 +0200 Message-ID: <4C5BABD1.2090405@easy-emacs.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1281076298 12555 80.91.229.12 (6 Aug 2010 06:31:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Aug 2010 06:31:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 06 08:31:37 2010 Return-path: Envelope-to: geh-help-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 1OhGSt-0000qE-B0 for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Aug 2010 08:31:35 +0200 Original-Received: from localhost ([127.0.0.1]:56308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhGSs-0002dn-K9 for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Aug 2010 02:31:34 -0400 Original-Received: from [140.186.70.92] (port=55776 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhGSQ-0002di-Eq for help-gnu-emacs@gnu.org; Fri, 06 Aug 2010 02:31:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OhGSP-0001Ht-0W for help-gnu-emacs@gnu.org; Fri, 06 Aug 2010 02:31:06 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.10]:52832) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhGSO-0001HU-M7 for help-gnu-emacs@gnu.org; Fri, 06 Aug 2010 02:31:04 -0400 Original-Received: from [192.168.178.27] (p5DDB0A9A.dip0.t-ipconnect.de [93.219.10.154]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MSVpQ-1OZaxV3uEu-00S4pL; Fri, 06 Aug 2010 08:31:02 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 In-Reply-To: X-Provags-ID: V02:K0:/Zxb/TqCa1EUPhnz5KfxyFgOnmLXTauoaHObiO4UoyG 9/34r6dxNDioxWZLvOjGDzUk5JWQVET8l6qhkOxhWYBQT+wSnM pR9o2Hzm/dlPkkjcRNGYwCYRsG8No0hwEPM+GGrKrr2AQ7r6SB Hg5rLV50JMamTQMwd4fbaXZ3JCmCMheDZWZyEeqZoXrBjGZGSK nR5ffUpgZKGXuymqWcLleXxcp6Fcs2kJOFhc4H8pBo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:74466 Archived-At: Am 06.08.2010 06:04, schrieb Deniz Dogan: > 2010/8/6 suvayu ali: >> Hi everyone, >> >> I have a strange problem, recently some of my regexps started becoming >> less "hungry" than usual. For example I have a file like this, >> >> #1 153030 120 = 423988 >> #2 152845 181 = 1500234 >> #3 155160 247 = 767821 >> #4 155160 310 = 11131347 >> #5 155160 319 = 13979167 >> >> I wanted to remove the 3rd column of numbers along with the = sign. So >> I called `query-replace-regexp' with this regexp replacement, >> >> `[0-9]+ = ->' >> >> But this matches the numbers like this, >> >> 120 = >> 1 = >> 7 = >> 0 = >> 9 = >> >> where as I am expecting it to be this, >> >> 120 = >> 181 = >> 247 = >> 310 = >> 319 = >> >> This is just one instance, I have faced similar other cases. I get the >> proper expected match only for the first match, for the subsequent >> matches the regexp becomes less "hungry". >> >> Is this a consequence of some conflicting settings or a possible bug? >> I see this behaviour with GNU Emacs 24.0.50.1, emacs-snapshot from an >> Ubuntu Lucid ppa and emacs compiled from source on Fedora 12. (but the >> settings are identical for both these setups) >> >> Thanks in advance for any comments/hints about this issue. :) >> >> -- >> Suvayu >> >> Open source is the future. It sets us free. >> >> > > That's weird, it happens to me to on: > GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7600) of 2010-07-12 on 3249CTO > > I noticed two things when tinkering around with this problem. > > 1. M-x re-builder correctly highlights the portions we both expect. > 2. It's only the *highlighting* in query-replace-regexp that > fails. When performing the actual replacing, it works just as > expected. > > I'm sensing that this is a bug of some sort and you should report it. > same at GNU Emacs 23.1.92.1 (i686-pc-linux-gnu, GTK+ Version 2.12.0) of 2010-02-19 replacement works as desribed, just the highlighting fails.