SVG 文件:删除每个 <text> 个对象和内容 vim

SVG file: Delete every <text> object and contents w/ vim

我有一个包含数千个对象的 SVG 文件,所有对象都是 <text></text><path></path> 类型。

我需要删除 SVG/XML 中的每个基于文本的对象,同时删除标签和标签各自的内容。 文件是 非常大,我正在寻找单行解决方案。

:%s/<text\(\n\|.\)\{-}<\/text>//g
:%s                                Substitute command, applied to every line.
   /                               Pattern begins after this character.
    <text                          Opening tag.
         \(\n\|.\)                 Matches carriage returns or any other character. 
                  \{-}             Matches previous atom zero or more times but as few as possible.
                      <\/text>     Closing tag.
                              //   Replace with nothing.
                                g  Apply substitution to every match on the line.