I recently needed to do some multiline grepping through some log files. The problem is, the default grep and egrep on Linux systems don't seem to support regex patterns that extend over several lines.
Luckily, at least RHEL come with pcregrep installed, which does Perl-compatible regex matching. And by adding a -M switch you get multiline matching!
Hm. I'm running RHEL 5.something, and I have pcregrep 4.5, but it doesn't support a -M option. You must have a newer version of pcregrep. Back to perl for me.
4 comments:
Use ack! http://petdance.com/ack/
Thanks, pcregrep is exactly what I needed.
oc: I don't think ack does multiline matching, does it?
Hm. I'm running RHEL 5.something, and I have pcregrep 4.5, but it doesn't support a -M option. You must have a newer version of pcregrep. Back to perl for me.
Thanks dude, exactly what I needed.
Post a Comment