home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5637 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.0 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!gumby!yale!yale.edu!jvnc.net!darwin.sura.net!haven.umd.edu!mimsy!folta
  2. From: folta@cs.umd.edu (Wayne Folta)
  3. Newsgroups: comp.lang.perl
  4. Subject: String matching with matching delimiters
  5. Message-ID: <59999@mimsy.umd.edu>
  6. Date: 31 Aug 92 21:30:16 GMT
  7. Sender: news@mimsy.umd.edu
  8. Distribution: usa
  9. Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
  10. Lines: 16
  11.  
  12. I have been doing a lot of work lately manipulating TeX files with perl. Is
  13. there an easy way to give a pattern like:
  14.  
  15.    /\\hbox{ ... }/
  16.  
  17. Where the "..." includes everything up to the *matching* brace. This may
  18. include closing braces, so "{[^}]+}" does not work. Presently, I loop through
  19. the string counting opens and closes by hand... I don't think rexegp's are
  20. powerful enough to do it alone, but in perl...
  21.  
  22. (Also, could rindex be enhanced to be able to match the right-most ocurrence
  23. *before* a certain point? I.e. to be symmetrical with index.)
  24. -- 
  25.  
  26.  
  27. Wayne Folta          (folta@cs.umd.edu  128.8.128.8)
  28.