Article View: gnu.emacs.help
Article #2062Want fn. to replace regexps w/ parenthesized groups.
From: Ethan Bradford
Date: Tue, 05 Jan 1993 09:41
Date: Tue, 05 Jan 1993 09:41
17 lines
1167 bytes
1167 bytes
I am trying to translate from one format for expressions (Theorist) to
another (LaTeX). I can almost specify the translation as a list of
sed regular expression replace commands. The only problem is with
replacing something like "(A#B C D)" with "\product_{B=C}^{D}A",
where A, C, and D are arbitrary expressions, and so could potentially
contain the delmiter (tab) that separates fields in Theorist's
version of the product.
So, what I want is to be able to specify the substitution as something
like "\(\X\)#\(\w*\) \(\X\) \(\X\))" => "\\product_{\2=\3}^{\4}\1",
where \X matches any s-expression.
Does anybody have utilities for doing such a thing?
Thanks.
-- Ethan
Technical Details
Message-ID:
<ETHANB.93Jan5094108@ptolemy.astro.washington.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!wupost!gumby!destroyer!cs.ubc.ca!uw-beaver!news.u.washington.edu!news.u.washington.edu!ethanbShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!wupost!gumby!destroyer!cs.ubc.ca!uw-beaver!news.u.washington.edu!news.u.washington.edu!ethanb From: ethanb@ptolemy.astro.washington.edu (Ethan Bradford) Newsgroups: gnu.emacs.help Subject: Want fn. to replace regexps w/ parenthesized groups. Date: 5 Jan 93 09:41:08 Organization: U. of Washington Lines: 17 Message-ID: <ETHANB.93Jan5094108@ptolemy.astro.washington.edu> NNTP-Posting-Host: ptolemy.astro.washington.edu