fork download
  1. string = "\n <img alt=\"testing artice breaking news\" src=\"something.com\" />\n <p>\n \tnew vision content for testing rss feeds\n </p>\n"
  2. p string.gsub(/<p(?:\s[^>]*)?>.*?<\/p>/m, '')
  3.  
  4. tagname = "p"
  5. rx = /<#{tagname}(?:\s[^>]*)?>(?:[^<]*(?:<(?!#{tagname}[\s>]|\/#{tagname}>)[^<]*)*|\g<0>)*<\/#{tagname}>/
  6. p string.gsub(rx, '')
Success #stdin #stdout 0.01s 6040KB
stdin
Standard input is empty
stdout
"\n <img alt=\"testing artice breaking news\" src=\"something.com\" />\n \n"
"\n <img alt=\"testing artice breaking news\" src=\"something.com\" />\n \n"