help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on re-search-forward and infinite loop


From: David Maus
Subject: Re: Question on re-search-forward and infinite loop
Date: Mon, 30 Nov 2009 09:24:34 +0100
User-agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1.50 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi there,

At Thu, 26 Nov 2009 18:17:16 -0500,
Barry Margolin wrote:
> 
> Your regexp matches zero or more whitespace characters at the beginning 
> of a line.  If there's an empty line at the end of the buffer, it will 
> match that.  But since it's a zero-length match, point is left at that 
> position, and the next time around it again matches it.
> 
> In general, whenever a regexp can match a zero-length string, I think 
> that type of loop will go infinitely.

Thanks, this makes perfect sense to me.

Regards,

  -- David
-- 
OpenPGP... 0x316F4BE4670716FD
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com
ICQ....... 241051416




reply via email to

[Prev in Thread] Current Thread [Next in Thread]