develooper Front page | perl.beginners | Postings from February 2002

RE: Reg Exp help

Thread Previous | Thread Next
From:
Busse, Rich
Date:
February 27, 2002 04:57
Subject:
RE: Reg Exp help
Message ID:
E53C5C383912D511BB0F00508BB80B9A01BD179A@exbhbhmb06.us.dnb.com
Thanks Daryl & 'Japhy' for your suggestions. I ended up using:

	$Out = `$Cmd` ;
	$Out =~ /^\|GRP\|\s*(.*)/m ;

The data I want ends up in $1.

-----Original Message-----
From: Busse, Rich 
Sent: Tuesday, 26 February, 2002 09:35
To: Perl Beginners
Subject: Reg Exp help


I am capturing the output of a command in a string:

	$Out = `$Cmd` ;

The output always looks like:

List of Templates and Template Groups assigned to 'somenode.us.dnb.com':
====================================================================
|GRP| SBS-DSM
====================================================================
Operation successfully completed.

It's always on 5 separate lines. How do I extract what follows |GRP| on the
third line to a variable? TIA...

Thread Previous | 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