grep和带(*,*)的表达式

grep和带(*,*)的表达式,grep,Grep,我在一个大型项目中加入了write(*,*)。现在我想要格雷普 grep -n 'write(*,*)' response.f 什么也没找到。为什么带括号的表达式不适用于经典grep?括号不是问题,但*是正则表达式元字符。请尝试grep-nF不解释为正则表达式: grep -nF 'write(*,*)' response.f 或者,另一种选择是逃避: grep -n 'write(\*,\*)' response.f 您的正则表达式被解释为“零或多个(,然后是零或多个,,然后是)括号不是

我在一个大型项目中加入了
write(*,*)
。现在我想要格雷普

grep -n 'write(*,*)' response.f

什么也没找到。为什么带括号的表达式不适用于经典grep?

括号不是问题,但
*
是正则表达式元字符。请尝试
grep-nF
不解释为正则表达式:

grep -nF 'write(*,*)' response.f
或者,另一种选择是逃避:

grep -n 'write(\*,\*)' response.f

您的正则表达式被解释为“零或多个
,然后是零或多个
,然后是

括号不是问题,但是
*
是正则表达式元字符。请尝试
grep-nF
不解释为正则表达式:

grep -nF 'write(*,*)' response.f
或者,另一种选择是逃避:

grep -n 'write(\*,\*)' response.f
您的正则表达式被解释为“零或更多
,然后零或更多
,然后