【发布时间】:2013-11-25 20:33:55
【问题描述】:
下面的模式效果很好,我得到了数百个结果。
xargs pcregrep -M "select.*table(.)*" >> $grep_out
这会返回(样本):
./mo/module1/module1.4gl: call error("Prepare select_table failed.")
./mo/module1/module1.4gl: declare select_table cursor with hold for sel_table
./mo/module1/module1.4gl: let prep = " select * from table ",
当我在最后一个结束字符上添加 OR 时,我得到 0 个结果:
xargs pcregrep -M "select.*table(.|\n)*" >> $grep_out
这对我来说完全没有意义。我正在添加一个 OR - 从逻辑上讲,它不应该做任何事情,只是扩展我的搜索并增加我的结果。不要减少它们。这是怎么回事?
【问题讨论】:
-
请添加示例数据
-
我无法用您的示例数据重现这一点。使用
bash4.2.45(1)-release 和pcregrep8.31 测试。