Questions tagged «pcregrep»

11
如何在文件中搜索多行模式?
我需要找到所有包含特定字符串模式的文件。我想到的第一个解决方案是使用通过xargs grep传递的find: find . -iname '*.py' | xargs grep -e 'YOUR_PATTERN' 但是,如果我需要找到跨越多条线的模式,则会陷入困境,因为vanilla grep无法找到多线模式。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.