[X-Unix] Any CLI multi-line regex find utilities out there?

Eugene list-themacintoshguy at fsck.net
Wed Oct 27 13:34:38 PDT 2004


On Wed, Oct 27, 2004 at 02:04:49PM +0200, Jakob Peterhänsel wrote:
: 
: I though grep could do it, as BBEdit's version can, but got 
: disappointed. Grep can't find over multi-lines... 
: 
: So, is there any CLI solutions out there that can return a match on 
: text over multi lines??? 
: 
: I would like to do something like: 
: 
: echo 'my very long text from a email body' | myRegexCmd 'regex expression' 

Vanilla grep(1) does not support matches across newline boundaries.
However, there are several 3rd-party solutions that will do it.
Here's one, written in Perl:

	http://freshmeat.net/projects/mg_multi_line_grep/


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/


More information about the X-Unix mailing list