perl -ne'print if /^\[moo\]/ ... /^\[/ and !/^\[/' log.txt