all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Regex is not being as "hungry" as it is supposed to
@ 2010-08-06  1:37 suvayu ali
  2010-08-06  4:04 ` Deniz Dogan
  0 siblings, 1 reply; 7+ messages in thread
From: suvayu ali @ 2010-08-06  1:37 UTC (permalink / raw)
  To: Emacs mailing list

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.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-08-07  0:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-06  1:37 Regex is not being as "hungry" as it is supposed to suvayu ali
2010-08-06  4:04 ` Deniz Dogan
2010-08-06  6:29   ` Andreas Röhler
2010-08-06  6:49     ` Tassilo Horn
2010-08-06  7:03       ` suvayu ali
2010-08-06  7:36         ` Andreas Röhler
2010-08-07  0:44           ` suvayu ali

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.