[Bug: 21.4.15] replace-regexp
Vin Shelton
acs at xemacs.org
Thu Mar 16 11:41:55 EST 2006
Hi Chris,
On 3/16/06, Chris Rowse <chris at forth.co.za> wrote:
> To: XEmacs Beta <xemacs-beta at xemacs.org>
> Subject: [Bug: 21.4.15] replace-regexp
> --text follows this line--
> ================================================================
> Dear Bug Team!
>
> I'm having a problem with replace-regexp
> I need to pick up the matched regular expression and insert it in
> the
> output \1 is not working for me.
>
> Maybe I am doing something wrong?
> I cant google anything on the subject, I'v tried combinations of \&1
> etc to no avail.
>
>
> replace-regexp
> <xsl:template match=[\"a-zA-Z0-9]+><RET>
> <xsl:template match=\1 mode="body"><RET>
>
>
> input buffer
> <xsl:template match="helloworld">
>
> output expected
> <xsl:template match="helloworld" mode="body">
>
> output received
> <xsl:template match= mode="body">
>
It wasn't completely clear to me what you had done. Do you know that
the part to be repeated must be enclosed in between \( and \) ?
E.g.
C-x b *scratch*
M-x replace-regexp
\(for\)
xxx\1yyy
This will replace all occurances of "for" with xxxforyyy.
Hope this helps. Please follow up if it doesn't.
Vin
--
Whoever you are, no matter how lonely,
the world offers itself to your imagination,
calls to you like the wild geese, harsh and exciting--
over and over announcing your place
in the family of things. Mary Oliver
More information about the XEmacs-Beta
mailing list