From owner-freebsd-questions Fri Jan 5 16:38:38 2001 From owner-freebsd-questions@FreeBSD.ORG Fri Jan 5 16:38:37 2001 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from gilliam.users.flyingcroc.net (unknown [207.246.128.2]) by hub.freebsd.org (Postfix) with ESMTP id DAA3637B400 for ; Fri, 5 Jan 2001 16:38:36 -0800 (PST) Received: from flyingcroc.net (flyingcroc.net [207.246.128.245]) by gilliam.users.flyingcroc.net (8.9.3/8.9.3) with ESMTP id QAA42279; Fri, 5 Jan 2001 16:35:48 -0800 (PST) Date: Fri, 5 Jan 2001 16:35:48 -0800 (PST) From: Calvin X-Sender: calvin@gilliam.users.flyingcroc.net To: G D McKee Cc: freebsd-questions Subject: Re: Perl - IP Address In-Reply-To: <001001c07773$dbfe62c0$0500a8c0@gdmckee.local> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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