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

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

Re: regex bug with pattern "\\*/" matching end of buffer */


From: Geoff Odhner
Subject: Re: regex bug with pattern "\\*/" matching end of buffer */
Date: Mon, 2 May 2005 08:54:53 -0400

Thank you.  I am relieved to find the bug is in my code.  Indeed, it works 
correctly when I recode it thus:
         (while (and (re-search-forward "\\*/"  nil t) (replace-match 
"*-/" nil nil)) (not (eobp))))

Geoff Odhner


Richard Stallman <address@hidden> wrote on 04/30/2005 07:18:50 PM:

>          (while (and (re-search-forward "\\*/"  nil t) (not (eobp)))
>       (replace-match "*-/" nil nil)))
> 
>     it will give me the following line as the result:
> 
>        char   ch;   /-* sample comment */
> 
> That's because (eobp) returns t when you're at the end of the
> accessible portion of the buffer.  So the bug is in your code,
> I think.
> 





reply via email to

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