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

pcregrep match groups

Thread Next
From:
Chris Allen
Date:
October 18, 2009 05:45
Subject:
pcregrep match groups
Message ID:
12d155f9-9c65-40cb-bde7-cc59ae42ea5e@t11g2000prh.googlegroups.com
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About