Shawn H Corey
|| at May 24, 2011 at 12:05 pm
On 11-05-24 12:10 AM, vishesh kumar wrote:
I am a linux system admin. I want to use perl as a command line like sed
For example suppose , i need to extract IP Addr from a string or file using
str="hello ip is 192.168.2.1 and data is xxx"
And i want ip addr only using Regex
echo $str | perl -pe ??????
Please guide me,
Download the module Regex::Common from CPAN:http://search.cpan.org/~abigail/Regexp-Common-2011041701/lib/Regexp/Common.pm
The pattern Regex::Common::net matches IPv4 addresses.
Just my 0.00000002 million dollars worth,
Confusion is the first step of understanding.
Programming is as much about organization and communication
as it is about coding.
The secret to great software: Fail early & often.
Eliminate software piracy: use only FLOSS.