home *** CD-ROM | disk | FTP | other *** search
- 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
- From: folta@cs.umd.edu (Wayne Folta)
- Newsgroups: comp.lang.perl
- Subject: String matching with matching delimiters
- Message-ID: <59999@mimsy.umd.edu>
- Date: 31 Aug 92 21:30:16 GMT
- Sender: news@mimsy.umd.edu
- Distribution: usa
- Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
- Lines: 16
-
- I have been doing a lot of work lately manipulating TeX files with perl. Is
- there an easy way to give a pattern like:
-
- /\\hbox{ ... }/
-
- Where the "..." includes everything up to the *matching* brace. This may
- include closing braces, so "{[^}]+}" does not work. Presently, I loop through
- the string counting opens and closes by hand... I don't think rexegp's are
- powerful enough to do it alone, but in perl...
-
- (Also, could rindex be enhanced to be able to match the right-most ocurrence
- *before* a certain point? I.e. to be symmetrical with index.)
- --
-
-
- Wayne Folta (folta@cs.umd.edu 128.8.128.8)
-