develooper Front page | perl.beginners | Postings from October 2009

pcregrep match groups

Thread Next
Chris Allen
October 18, 2009 05:45
pcregrep match groups
Message ID:
I'm using pcregrep in a pipeline to match some information for a
network monitoring system.  I'm having a bit of a problem doing this
smoothly with the least amount of code.  One thing in particular is
driving me crazy - I can't figure out how to output only the contents
of my match groups with pcregrep.

Here's what I'm doing:

      echo status dir | bconsole | pcregrep -M '^Sched.*:\n(.*\n)*?

I only want pcregrep to write to stdout the data in match group 1, ie
the stuff inside (.*\n)

Is there a way to do this with pcregrep?

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About