unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* regexp to strip off LaTeX command
@ 2008-12-18  9:08 henry atting
  2008-12-18  9:19 ` Andreas Politz
  2008-12-22  2:47 ` Plamen Tanovski
  0 siblings, 2 replies; 8+ messages in thread
From: henry atting @ 2008-12-18  9:08 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

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?

henry



^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: regexp to strip off LaTeX command
@ 2008-12-19  9:47 Bourgneuf Francois
  0 siblings, 0 replies; 8+ messages in thread
From: Bourgneuf Francois @ 2008-12-19  9:47 UTC (permalink / raw)
  To: henry atting, help-gnu-emacs

> -----Message d'origine-----
> De : 
> help-gnu-emacs-bounces+francois.bourgneuf=groupe-mma.fr@gnu.or
> g 
> [mailto:help-gnu-emacs-bounces+francois.bourgneuf=groupe-mma.f
> r@gnu.org] De la part de henry atting
> Envoyé : jeudi 18 décembre 2008 10:48
> À : help-gnu-emacs@gnu.org
> Objet : Re: regexp to strip off LaTeX command
> 
> Zitat - Andreas Politz * Do Dez 18 2008 um 10:19 -
> 
> > henry atting wrote:
> >> Hi,
> >>
> >> 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?
> >>
> >> henry
> >>
> >
> > \\textit{\([^}]*\)} -> \1
> >
> > If you need to handle escaped brackets the regexp gets a 
> little longer.
> >
> > -ap
> 
> Thanks, works fine. :)
> 
> I understand the first part but can you please explain what 
> `\1' stands
> for?
> 
> henry
> 

\1 stands for "what is found between the first parenthesis \( [^}]* \)"
Example :
\(foo\).*\(bar\) ->\1 \2 would return foo bar (if foo and bar were found in the text, of course).
Bour9




^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <mailman.3104.1229680078.26697.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2008-12-22  2:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18  9:08 regexp to strip off LaTeX command henry atting
2008-12-18  9:19 ` Andreas Politz
2008-12-18  9:47   ` henry atting
2008-12-18 15:15     ` Andreas Politz
2008-12-18 13:27   ` Arnaldo Mandel
2008-12-22  2:47 ` Plamen Tanovski
  -- strict thread matches above, loose matches on Subject: below --
2008-12-19  9:47 Bourgneuf Francois
     [not found] <mailman.3104.1229680078.26697.help-gnu-emacs@gnu.org>
2008-12-20 14:11 ` henry atting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).