开发者

how to remove `<h2 class='title'>Some text</h2>` using sed?

to remove text1, I simply use:

find mydirectory -type f -exec sed -i 's/text1//ig' {} +

but how to remove <h2 class='title'>Some text</开发者_开发百科h2>?

I cannot simply remove using below code. it not works:

find mydirectory -type f -exec sed -i 's/<h2 class='title'>Some text</h2>//ig' {} +


You would need to escape the special characters

find mydirectory -type f -exec sed -i 's/<h2 class=\'title\'>Some text<\/h2>//ig' {} +
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜