From: Ben Tilly Date: 2001-02-06T07:40:24+09:00 Subject: [ruby-talk:10388] Re: Structured text matching? schuerig@acm.org (Michael Schuerig) wrote: > >I'm trying to match and extract pieces from structured text in a similar >way to what sgrep (see ) >does. > >The concrete purpose is to get titles from HTML files, that is the first >occurrence of any text between and . Better still, I'd >like to get the "X" from .... X ... > >Is there a idiomatic way to do such a thing in Ruby? In particular, it >would be very nice, if I could specify what I want in a way similar to >the above. I don't know what tools exist for this, but I am in the process of rolling some basic infrastructure for exactly this type of problem. Dunno when I will have anything suitable for public consumption, but take a look at http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/10374 for my initial thoughts. If this matures it would be something conceptually similar to (but less fully featured than) Perl's Parse::RecDescent. Cheers, Ben _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com