A simple question about whether this can be done with regular
expressions in Ruby:
str = <<EOS
start
between1
between2
between3
between4
end
EOS
re = /what here?!/
puts str.gsub(re, ‘----------------- zapped -------------------’)
Can re be written so the output is similar to:
start
between1
between2
between3
between4
end
I tried the following, but no luck:
re = / and replace anything in between, but regexps are
just sweet, so I was still trying with them.