From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.help Subject: Re: Regex is not being as "hungry" as it is supposed to Date: Fri, 6 Aug 2010 06:04:18 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1281067516 25112 80.91.229.12 (6 Aug 2010 04:05:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Aug 2010 04:05:16 +0000 (UTC) Cc: Emacs mailing list To: suvayu ali Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 06 06:05:15 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 1OhEBG-0002kw-8e for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Aug 2010 06:05:14 +0200 Original-Received: from localhost ([127.0.0.1]:38199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhEBF-00050n-TI for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Aug 2010 00:05:13 -0400 Original-Received: from [140.186.70.92] (port=41683 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OhEAs-00050d-Ux for help-gnu-emacs@gnu.org; Fri, 06 Aug 2010 00:04:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OhEAr-0007WE-MV for help-gnu-emacs@gnu.org; Fri, 06 Aug 2010 00:04:50 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:47892) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhEAr-0007Vw-KR for help-gnu-emacs@gnu.org; Fri, 06 Aug 2010 00:04:49 -0400 Original-Received: by vws16 with SMTP id 16so6716077vws.0 for ; Thu, 05 Aug 2010 21:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=mj9BI1VPw+I6l8tMRAJhNTkgivoWzQxnufRUtlM4lPs=; b=pT0UoqzGgZzMHhF6aPzHsiGVf/mYWSQBgyvL8d+ilLQqjlpYAV4eeblGrAlqIa22Io dsijAw4yoCvw4dVDJxAAmDfogVnt5/RERIC/6JW8UavGHlWjR01yoQO00wx0s0AS1z33 3J2V+ZDeCQV8pBuEDKEQeO1pab0RvhEGrdb8o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=doR0vuAVL+NJCtwU1IrPvXMQrY/fYz+jXrXiXTnxDsgUfViQsofQ3iHHx3H0tZuPKb 7+upfZXak9WOTEgnSVnZQrHQRkgjmy1PS/KPjmNYSsDEmiMxg2i5/zNz1K1++j640Gid LZEHWtF7/4YxBV4d9KxmPQb3YPqsPeVpi4s/A= Original-Received: by 10.220.124.21 with SMTP id s21mr7925221vcr.85.1281067488437; Thu, 05 Aug 2010 21:04:48 -0700 (PDT) Original-Received: by 10.220.188.77 with HTTP; Thu, 5 Aug 2010 21:04:18 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:74465 Archived-At: 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. -- Deniz Dogan