if I search for "proto_tree_add_text" I want back
proto_tree_add_text(subtree, tvb, curr_offset, 1, "%s : Reserved", bigbuf);
and
proto_tree_add_text(tree, tvb, offset, payload_len, "Payload");
equally. I _don't_ want the extra one-size-fits-all fluff returned by GNU grep's "-A" flag.
how about this untested one-liner:
perl -ne 'BEGIN{undef $/};print /(proto_tree_add_text\s*(.+?;\s+\n)/gs'
i think the semicolon will work as a search terminator, ymmv of course