From: daz Date: 2003-06-07T08:28:16+09:00 Subject: Re: regexp across multiple lines "Jim Freeze" wrote in message news:20030606162954.A29519@freeze.org... > Hi: > > I am trying to strip statements, > that occur across multiple lines, from an html document. > > For a on a single line I find that this works: > > html.gsub(/]*>.*(<\/script>)/i, "") > > I don't see why this does not work across multiple lines: > > html.gsub(/]*>.*(<\/script>){1,1}/mi, "") > > I thought the {1,1} would tell it to match only one . > > Regexp experts, I welcome your input. > > -- > Jim Freeze > ---------- > Bumper sticker: > > "All the parts falling off this car are of the very finest British > manufacture" > ? after .* makes it less greedy ... html = < Blah   

 
Notes blah

 stuff
- lose this
 more stuff
EHTML html.gsub!(/]*>.*?(<\/SPAN>)/mi, "") puts html #------------------------------------

Blah   

 

 stuff

 more stuff
#------------------------------------ daz