* get prematched text?
@ 2004-08-07 13:27 Vektor
2004-08-07 14:58 ` Pascal Bourguignon
2004-08-08 7:49 ` Alan Mackenzie
0 siblings, 2 replies; 3+ messages in thread
From: Vektor @ 2004-08-07 13:27 UTC (permalink / raw)
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?
thanks in advance.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: get prematched text?
2004-08-07 13:27 get prematched text? Vektor
@ 2004-08-07 14:58 ` Pascal Bourguignon
2004-08-08 7:49 ` Alan Mackenzie
1 sibling, 0 replies; 3+ messages in thread
From: Pascal Bourguignon @ 2004-08-07 14:58 UTC (permalink / raw)
Vektor <vektor@126.com> writes:
> 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?
>
> thanks in advance.
match-string
--
__Pascal Bourguignon__ http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: get prematched text?
2004-08-07 13:27 get prematched text? Vektor
2004-08-07 14:58 ` Pascal Bourguignon
@ 2004-08-08 7:49 ` Alan Mackenzie
1 sibling, 0 replies; 3+ messages in thread
From: Alan Mackenzie @ 2004-08-08 7:49 UTC (permalink / raw)
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").
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-08-08 7:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-07 13:27 get prematched text? Vektor
2004-08-07 14:58 ` Pascal Bourguignon
2004-08-08 7:49 ` Alan Mackenzie
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.