[Top][All Lists]

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

Re: regexp to strip off LaTeX command

From: Andreas Politz
Subject: Re: regexp to strip off LaTeX command
Date: Thu, 18 Dec 2008 16:15:01 +0100
User-agent: Mozilla-Thunderbird (X11/20081018)

henry atting wrote:
Zitat - Andreas Politz * Do Dez 18 2008 um 10:19 -

henry atting wrote:

I am searching a regexp for `replace-regexp' to remove only one LaTeX
command. Let's say I want to remove all \textit{} commands but not the
text within the braces, how can I do this?


\\textit{\([^}]*\)} -> \1

If you need to handle escaped brackets the regexp gets a little longer.


Thanks, works fine. :)

I understand the first part but can you please explain what `\1' stands


\1 is a backreference and refers to the 1st parenthese group, much like
a variable.

Here is a better explanation, somewhere in the middle.

(info "(elisp)Regexp Backslash")


reply via email to

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