本文介绍了为什么我不能在这种情况下,模式匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<tr>$
<td nowrap valign="top" class="table_1row"><a name="d071301" id="d071301"></a>13-Jul-2011</td>$
我想匹配 TR&GT; $&LT; TD VALIGN NOWRAP
,但是当我尝试
grep -c "tr>\n<td nowrap valign" test.html
然后我也试过
grep -c "tr>\n\s*<td nowrap valign" test.html
他们都找到什么。有什么错误吗?
both of them find nothing. What error here?
还有一个问题,我可以通过使用SED ???谢谢添加字符^ M转换成HTML文件
One more question, can i add a character ^M into a html file by using sed???thanks
推荐答案
的grep
只做一行搜索。 Another源
要回顾一下上的一些评论, SED
做多行搜索,可以解决与 \\ r
To recap on some comments,
sed
does multiline searches and you can address the carriage return in sed syntax with \r
这篇关于为什么我不能在这种情况下,模式匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!