Regex GREP-“;点匹配换行”;选项
例如:Regex GREP-“;点匹配换行”;选项,regex,linux,bash,grep,Regex,Linux,Bash,Grep,例如: ... Line some text other text 10 ... 是否可以告诉GREP^Line.*?^10$使点也与换行符匹配,我得到以下输出: Line some text other text 10 如果没有,是否有一些Linux CLI工具可以做到这一点?如果您打算在行和10之间输出行,我建议使用awk: awk '/^Line$/,/^10$/' myfile 使用sed: sed -rn '/^Line$/,/^10$/p' filename 可能重复
...
Line
some text
other text
10
...
是否可以告诉GREP^Line.*?^10$
使点也与换行符匹配,我得到以下输出:
Line
some text
other text
10
如果没有,是否有一些Linux CLI工具可以做到这一点?如果您打算在
行
和10
之间输出行,我建议使用awk:
awk '/^Line$/,/^10$/' myfile
使用sed
:
sed -rn '/^Line$/,/^10$/p' filename
可能重复