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[^>]>.(</script>)/i, “”)
I don’t see why this does not work across multiple lines:
html.gsub(/<script[^>]>.(</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”
daz
(daz)
2
“Jim Freeze” jim@freeze.org 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[^>]>.(</script>)/i, “”)
I don’t see why this does not work across multiple lines:
html.gsub(/<script[^>]>.(</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 = <<EHTML
Notes blah
stuff
- lose this
more stuff
EHTML
html.gsub!(/<SPAN[^>]>.?(</SPAN>)/mi, “”)
puts html
···
#------------------------------------
stuff
more stuff
#------------------------------------
daz