From: Shai Rosenfeld Date: 2007-08-05T16:41:17+09:00 Subject: Re: sgub stretching over several lines Jan Ask wrote: > Hi, > > I am trying to do a in a replace a long (multiple line) string: > > string = string.gsub(/<h3 > class="field-label>audience<\/h3> > <div class="field-items> > <div class="field-item>/, '') > > It somehow doesn't seem to work. > > I would like to know how to use a wildcard like '*', '%' or '...' like > below: > > string = string.gsub(/<h ... tem>/, '') > > Thanks! > Ask > string = string.gsub(/<h.*tem>/, '') .* # the . regexp wildcard means, 'any' character (space, symbol, letter) # the * regexp wildcard is an operator saying: any regexp match before me can appear 0 or more times: i.e, you get whatever character you want, however many times you want it, between the '<h' string and the 'tem>' string. hth happy sunday btw -- Posted via http://www.ruby-forum.com/.