Starting with your little question:
如何做到这一点?
The second example will not search inside child directories of dir
starting with a .
(because they won t be matched by the glob). So if you a directory that looks like this:
dir/
.a_dotted_dir/
a_visible_dir/
第一个例子将在<代码>.a_dotted_dir内查询。 而第二个例子则不会。
怎样才能形成一种与上述职能相匹配的模式,而只是让我回来呢?
You can t, with grep by itself. Grep just matches patterns but does not perform any sort of processing on them. You can probably accomplish what you want by listing files that match your search pattern and processing them with sed, something like:
grep -rl "this->translate( .* )" dir |
xargs sed -n "s/.*this->translate( ([^ ]*) ).*/1/p"
此外,我注意到,我刚才对你的定期表达作了一些改动。 <代码>[->]与->
不相匹配,并将$<>ts
置于双引文内,最终将用空示取代“密码>。 您需要放弃<条码><美元/代码>、逃避或使用单一报价。