Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jan 2001 16:35:48 -0800 (PST)
From:      Calvin <calvin@mail.flyingcroc.net>
To:        G D McKee <freebsd@gdmckee.com>
Cc:        freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Perl - IP Address
Message-ID:  <Pine.BSF.4.21.0101051615000.30798-100000@gilliam.users.flyingcroc.net>
In-Reply-To: <001001c07773$dbfe62c0$0500a8c0@gdmckee.local>

next in thread | previous in thread | raw e-mail | index | archive | help
They may not look pretty, but they work.

To pull out the ip address, use ...

	\s+\w+\s+((?:\d+\S){3}\d+)(?:\s+\w+){3}\s+\S+

and to pull out the interface, use ...

	^(\w+)\:\s+flags.*$

btw, this isn't really a FreeBSD question :-)

> Hi
> 
> Does any one have a regular expression that will pull out an IP Address from
> ifconfig.  A regular network interface and a reg ex for tun0 for dial up?
> 
> G D McKee
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 

_____________________________________________________________________
Calvin M. Meloon				Flying Crocodile, Inc
System Admin						  Seattle, WA
Writer of code, Manipulator of Data		 Office: 206-374-0374
Security, Backups, & Recovery			   Cell: 206-255-8153
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0101051615000.30798-100000>