help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: get prematched text?


From: Alan Mackenzie
Subject: Re: get prematched text?
Date: Sun, 8 Aug 2004 07:49:43 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

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



reply via email to

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