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