From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: get prematched text? Date: Sun, 8 Aug 2004 07:49:43 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1091969506 24420 80.91.224.253 (8 Aug 2004 12:51:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 8 Aug 2004 12:51:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 08 14:51:39 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Btn9H-0003Yo-00 for ; Sun, 08 Aug 2004 14:51:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BtnCz-0005vs-20 for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Aug 2004 08:55:29 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!feed.news.tiscali.de!news.belwue.de!informatik.tu-muenchen.de!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 16 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1091969162 55619 193.149.49.134 (8 Aug 2004 12:46:02 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 8 Aug 2004 12:46:02 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:124698 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20032 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20032 Vektor 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").