home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / emacs / help / 5245 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.1 KB

  1. 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
  2. From: ethanb@ptolemy.astro.washington.edu (Ethan Bradford)
  3. Newsgroups: gnu.emacs.help
  4. Subject: Want fn. to replace regexps w/ parenthesized groups.
  5. Date: 5 Jan 93 09:41:08
  6. Organization: U. of Washington
  7. Lines: 17
  8. Message-ID: <ETHANB.93Jan5094108@ptolemy.astro.washington.edu>
  9. NNTP-Posting-Host: ptolemy.astro.washington.edu
  10.  
  11. I am trying to translate from one format for expressions (Theorist) to
  12. another (LaTeX).  I can almost specify the translation as a list of
  13. sed regular expression replace commands.  The only problem is with
  14. replacing something like "(A#B    C    D)" with "\product_{B=C}^{D}A",
  15. where A, C, and D are arbitrary expressions, and so could potentially
  16. contain the delmiter (tab) that separates fields in Theorist's
  17. version of the product.
  18.  
  19. So, what I want is to be able to specify the substitution as something
  20. like "\(\X\)#\(\w*\)    \(\X\)    \(\X\))" => "\\product_{\2=\3}^{\4}\1", 
  21. where \X matches any s-expression.
  22.  
  23. Does anybody have utilities for doing such a thing?
  24.  
  25. Thanks.
  26.  
  27. -- Ethan
  28.