[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regexp replacement
From: |
Jim Dai |
Subject: |
Re: Regexp replacement |
Date: |
Sat, 28 Oct 2006 15:11:30 -0400 |
User-agent: |
Microsoft-Entourage/11.1.0.040913 |
Once again, thanks for the solution. It basically solved my problem.
Two more questions:
1)
I wonder if there is an easy improvement on the current method so that I
have nested {} inside the text.
E.g. I would like to replace \redtext{some formula $\frac{a}{b}$} to
Some formula $\frac{a}{b}$.
2) I did not make it clear when I asked a key binding question. How can I
bind the entire key strokes M-x query-replace-regexp RET
\\redtext{\([^}]*\)} RET \1 RET into an emacs key?
This key binding is to be used in LaTeX mode.
Thanks.
On 10/27/06 6:45 PM, in article 85iri5nzt0.fsf@lola.goethe.zz, "David
Kastrup" <dak@gnu.org> wrote:
> Jim Dai <jgjimdai_p@yahoo.com> writes:
>
>> I would like to delete \redtext{long text} with "long text" being kept.
>> I have any instances in a file, with "long text" varying that may include
>> other latex symbols like _ $. (assume there are not any {} pairs inside the
>> text.
>>
>> How can I use regexp replacement to achieve the desired changes?
>
> M-x query-replace-regexp RET \\redtext{\([^}]*\)} RET \1 RET