帮解释下这个正则
目的是删除文本文件中的tag
# cat html.txt
<b>This</b> is what <span style="text-decoration: underline;">I</span> meant. Understand?
$ sed 's/<[^>]*>//g' html.txt
This is what I meant. Understand?
# cat html.txt
<b>This</b> is what <span style="text-decoration: underline;">I</span> meant. Understand?
$ sed 's/<[^>]*>//g' html.txt
This is what I meant. Understand?
2 回答1.4k 阅读✓ 已解决
1 回答671 阅读
1 回答658 阅读
1 回答2.2k 阅读✓ 已解决
<[^>]*>
分为三部分吧
匹配<
匹配不是>的内容, * 表明越多越好(贪婪匹配)
匹配>
综上就匹配到了tag了