Multi-line grep utility implemented n C++