all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Bourgneuf Francois" <francois.bourgneuf@groupe-mma.fr>
To: "henry atting" <nspm_01@literaturlatenight.de>, <help-gnu-emacs@gnu.org>
Subject: RE: regexp to strip off LaTeX command
Date: Fri, 19 Dec 2008 10:47:49 +0100	[thread overview]
Message-ID: <9884393F63F8AF4EA99527DC3C9141E208D2B8@zw67246c.societe.mma.fr> (raw)

> -----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




             reply	other threads:[~2008-12-19  9:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19  9:47 Bourgneuf Francois [this message]
     [not found] <mailman.3104.1229680078.26697.help-gnu-emacs@gnu.org>
2008-12-20 14:11 ` regexp to strip off LaTeX command henry atting
  -- strict thread matches above, loose matches on Subject: below --
2008-12-18  9:08 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9884393F63F8AF4EA99527DC3C9141E208D2B8@zw67246c.societe.mma.fr \
    --to=francois.bourgneuf@groupe-mma.fr \
    --cc=help-gnu-emacs@gnu.org \
    --cc=nspm_01@literaturlatenight.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.