且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用sed删除xml文件中的节点

更新时间:2023-11-24 15:11:22

尝试一下: sed's/< workdocument [^ \/] * \/>//'

在工作文档之后使用 [^/] * 代替.* ,以便其匹配不超过第一个/> . [^/] 匹配除/以外的所有字符.

This uses [^/]* instead of .* after workdocument so that its match doesn't exceed the first />. [^/] matches every character other than /.