home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5835 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  1.3 KB

  1. Path: sparky!uunet!gossip.pyramid.com!olivea!sgigate!odin!news.csd.sgi.com!iceskate.csd.sgi.com!krishna
  2. From: krishna@shamu.csd.sgi.com (Krishna Sethuraman)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: String matching with matching delimiters
  5. Message-ID: <KRISHNA.92Sep1122512@shamu.csd.sgi.com>
  6. Date: 1 Sep 92 17:25:12 GMT
  7. References: <59999@mimsy.umd.edu>
  8. Sender: news@news.csd.sgi.com (Net News)
  9. Distribution: usa
  10. Organization: /usr/people/krishna/.organization
  11. Lines: 17
  12. In-Reply-To: folta@cs.umd.edu's message of 31 Aug 92 21: 30:16 GMT
  13.  
  14.  
  15. I had this exact problem when I was trying to write something that would
  16. convert from ATK BE2 datastream format into LaTeX (specifically, to convert
  17. `eq' files to LaTeX - instant pub-domain wysiwyg equation editor!)
  18.  
  19. Regexps are not powerful enough to do arbitrary nesting.  A push-down automaton
  20. could do it, but that's my computability/complexity/automata course remnants
  21. swimming around in my brain (which I could never put into Perl code).  Anycase,
  22. I gave up eventually and used emacs-lisp code (forward-sexp, backward-sexp,
  23. and kill-sexp) for what I needed.
  24.  
  25. If someone has code for this, I'd like to look at it both so I can write an
  26. eq2latex.pl, and for the perl example experience.  Please mail me if you have
  27. any replies.
  28.  
  29. Krishna Sethuraman
  30. krishna@sgi.com
  31.