From: Zach Dennis Date: 2004-08-18T03:51:52+09:00 Subject: Re: multiple regexp matches Instead of using str.scan(re) use: re.match( str ); which returns a MatchData object. You can use the MatchData object's offset method to find your results.....i do believe. Zach Kevin Howe wrote: >I want to get multiple results of a regexp pattern match, offsets included. >The following code gets the proper results, but does not return offsets: > > str = ' ... ' > re = Regexp.new('(<(\/?)span>)', true) # match start or end tag > print str.scan(re).inspect > >The Regexp module will return offsets, but Regexp::match only returns the >first match, so I'm not sure how to get the full list of matches? > > > > > > >