I want to find all content between <code> tags in a string and replace
the content of these with new formatted content. Any suggestions why the
following code is not working?
self.content = self.content.gsub(/<code>(.*?)<\/code>/, 'new content')
Nope, because it is working:
irb(main):026:0> "This is <code>stuff</code>".gsub(/<code>(.*?)<\/
/, 'new content')
=> "This is new content"
You need to provide more details and code if you're experiencing something different.