sed是啥意思 sed如何替换匹配的数字?

sed如何替换匹配的数字?日志文件中的一行是:abc135hello。如果您想使用regular来查找,请分别使用命令egrep和sed。 问题1:在数字匹配中,D用于匹配数字,但不能将135与D匹配

sed如何替换匹配的数字?

日志文件中的一行是:abc135hello。如果您想使用regular来查找,请分别使用命令egrep和sed。 问题1:在数字匹配中,D用于匹配数字,但不能将135与D匹配,只能与[0-9]匹配。问题2:egrep可以用[0-9]正则化匹配135,但是sed不能[根@livedvdlog]#egrep“abcd[0-9]你好”tmp.txt文件 abcd135hello [根@livedvdlog]#egrep“你好”tmp.txt文件 [根@livedvd日志]#sed-n“/abcd[0-9]你好/p”tmp.txt文件 [根@livedvd日志]#sed-n“/abcdd您好/p”tmp.txt文件 [根@livedvd稍后,我试图找出D在sed中可以匹配的内容,发现是字母D而不是数字根@livedvd日志]#sed-n“s/d/aaaaaaaaaa/p”tmp.txt文件 abcaaaaa135hello [根@livedvd第一步是将<script->myself</script>替换为<script->myself</script>

第二步是终止<script>。*</script>

第三步是将<script->myself</script>替换为<script>myself</script>