unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alan Mackenzie <acm@muc.de>
Subject: Re: get prematched text?
Date: Sun, 8 Aug 2004 07:49:43 +0000	[thread overview]
Message-ID: <nul4fc.36.ln@acm.acm> (raw)
In-Reply-To: cf2lnl$dej$1@quimby.gnus.org

Vektor <vektor@126.com> wrote on Sat, 07 Aug 2004 21:27:56 +0800:
> some functions, such as "replace-match", use \N to present the Nth
> matched text in last regexp match.
> now i want to get the Nth prematched string directly, how to?

It's in the Elisp manual, on the page "The Match Data" and its sub-pages.
I think the function you want is "(match-string 2)" to get the second
substring.  

> thanks in advance.

-- 
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").

      parent reply	other threads:[~2004-08-08  7:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-07 13:27 get prematched text? Vektor
2004-08-07 14:58 ` Pascal Bourguignon
2004-08-08  7:49 ` Alan Mackenzie [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=nul4fc.36.ln@acm.acm \
    --to=acm@muc.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.
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).