$data = "dhcpd : LOG_INFO : DHCPDISCOVER from
52:41:53:20:c0:f6:c8:35:6c:80:c0:01:01:00:00:00 via eth0";
($new) = $data =~ /from\s+(.*)\s+via/;
print $new;
That should do it, as long as the data string you are looking for is
consistently surrounded by "from" and "via";
HTH
John
-----Original Message-----
From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]]
Sent: 03 September 2001 13:46
To: [EMAIL PROTECTED]
Subject: Re:Parse a file
Hi, folks, I have to parse a file which looks like this:
dhcpd : LOG_INFO : DHCPDISCOVER from
52:41:53:20:c0:f6:c8:35:6c:80:c0:01:01:00:00:00 via eth0
and I wanted to extract only this
52:41:53:20:c0:f6:c8:35:6c:80:c0:01:01:00:00:00
How can I do this with R.E.
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------Confidentiality--------------------------.
This E-mail is confidential. It should not be read, copied, disclosed or
used by any person other than the intended recipient. Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful. If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]