home *** CD-ROM | disk | FTP | other *** search
- Path: 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
-
- 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
-