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

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

Re: silly regexp-replace question: how to delete empty lines


From: Alan Mackenzie
Subject: Re: silly regexp-replace question: how to delete empty lines
Date: Thu, 4 Mar 2004 10:10:35 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Johan Bockgård <bojohan+news@dd.chalmers.se> wrote on Thu, 04 Mar 2004
02:31:27 +0100:
> "leo" <halloleo@noospaam.myrealbox.com> writes:

>> now i recall: i guess, the fact that "^[C-j]" works but "^$[C-j]"
>> doesn't, is kind of a regexp bug/feature in emacs, isn't it?

>     For historical compatibility reasons, `$' can be used only at the
>     end of the regular expression, or before `\)' or `\|'.

>     For historical compatibility reasons, `^' can be used only at the
>     beginning of the regular expression, or after `\(' or `\|'.

> (info "(elisp)Regexp Special")

Yes, it's a pain in the backside.  But leo could write his regexp thus:

"^\\($\\)[C-j]".

> -- 
> Johan Bockgård

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").



reply via email to

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