removing html tags snippets

Removing HTML tags from a string in Ruby

Tagged regexp, ruby, removing html tags  Languages ruby

I don't take credit for the regexp. The source for it is Mastering Regular Expressions by Jeffrey E.F. Frield.

def remove_html_tags
    re = /<("[^"]*"|'[^']*'|[^'">])*>/
    self.title.gsub!(re, '')
    self.description.gsub!(re, '')
  end