原文件
First line
/* Comments
Comments
*/
*/
asdf
asdf
asdf
as/* Comments
asdf
*/
我想使用 sed 跨行匹配注释,匹配后的效果如下。
First line
asdf
asdf
asdf
as/* Comments
asdf
*/
我写的一个语句,但是不能贪婪匹配
sed -i '/^[a-z0-9A-Z_ \t]*\/\*/,/.*\*\//d' filename
效果如下,仍有一个*/没有匹配,但是又不能单独匹配删除*/,因为会删除其他的*/
First line
*/
asdf
asdf
asdf
as/* Comments
asdf
*/
请问如何在匹配多行的情况下,进行贪婪匹配,