def remove_tag(s, tag) return s.to_s.gsub("<#{tag}\b[^>]*>(.*?)", '\1') end # I want to be able to: # remove_tag("hrm...", "input") => "hrm..." # try this: def remove_tag(s, tag) s.to_s.match(/<#{tag}\b[^>]*>(.*?)<\/#{tag}>/)[1] end