From: yard-ape on
laredotornado wrote:
> On Dec 13, 12:35 pm, pk <p...(a)pk.invalid> wrote:
>> laredotornado wrote:
>>> Ok, I give up. How do you use sed to do a multiline search given a
>>> regular expression? I don't want to replace anything, just do a
>>> search, much like grep. However, I'm to understand that grep only
>>> searches one line at a time.
>> http://sed.sourceforge.net/sedfaq4.html#s4.23
>>
>> after reading that, you'll might think of switching to another tool.
>
> Do you have a suggestion, or even an example, or something else that
> can match multi-lines given a regular expression? - Dave

Perl and awk will get the job done, but structural regular expressions
is the simplest, cleanest model for this problem:

http://en.wikipedia.org/wiki/Sam_%28text_editor%29

If you need a non-interactive solution, just write the sam commands in
some file and do:

$ sam -d file.txt < script.sam
First  |  Prev  | 
Pages: 1 2
Prev: Use of 'set'
Next: The select builtin and white space