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' {} +
精彩评论