Python Forum

Full Version: Command wanted in Python: mgrep
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
what mgrep should do is take a grep argument that has line separators, and search the specified file(s) (or stdin if no files specified) for a match of the group of lines as a group. i also want the context output options -A, -B, and -C and the list option -l and the number option -n. suppose i search for foo\nbar. lots of files have lots of lines with foo. but none of those will match unless the line that follows has bar.
You want to compare your requirements with grin3's features. There are also many other results for 'grep' in pypi.