From: Tobias Reif Date: 2002-03-24T04:47:28+09:00 Subject: Re: extracting multi-line tags? Tobias DiPasquale wrote: > NOTE: What I mean here is that I would like to match the beginning of the > a href tag as one "token", then put the contents of the tag in another > token, while putting the closer tag in yet another token. ~ ---------8<---------- a = ' foo ' a =~ /()(.+?)(<\/a>)/m opening = $1 url = $2 content = $3 closing = $4 [opening,url,content,closing].each do |frag| puts frag.gsub /\n/, ' ' end --------8<---------- => ------- http://foo foo ------------- HTH, Tobi -- * peace&love. * http://www.pinkjuice.com/