From owner-freebsd-questions@FreeBSD.ORG Sat Dec 10 06:24:16 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D318716A41F for ; Sat, 10 Dec 2005 06:24:16 +0000 (GMT) (envelope-from parv@pair.com) Received: from mta13.adelphia.net (mta13.mail.adelphia.net [68.168.78.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C21643D4C for ; Sat, 10 Dec 2005 06:24:15 +0000 (GMT) (envelope-from parv@pair.com) Received: from default.chvlva.adelphia.net ([68.67.248.52]) by mta13.adelphia.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051210062415.TVIS28251.mta13.adelphia.net@default.chvlva.adelphia.net>; Sat, 10 Dec 2005 01:24:15 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id 5A279B540; Sat, 10 Dec 2005 01:24:01 -0500 (EST) Date: Sat, 10 Dec 2005 01:24:01 -0500 From: Parv To: Glenn Dawson Message-ID: <20051210062401.GA9151@holestein.holy.cow> Mail-Followup-To: Glenn Dawson , Martin McCormick , freebsd-questions@freebsd.org References: <200512092212.jB9MCQhn092277@dc.cis.okstate.edu> <6.2.3.4.2.20051209145132.025e64c0@cobalt.antimatter.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6.2.3.4.2.20051209145132.025e64c0@cobalt.antimatter.net> Cc: Martin McCormick , freebsd-questions@freebsd.org Subject: Re: Regular Expression Trouble X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2005 06:24:16 -0000 in message <6.2.3.4.2.20051209145132.025e64c0@cobalt.antimatter.net>, wrote Glenn Dawson thusly... > > At 02:12 PM 12/9/2005, Martin McCormick wrote: > > > > I was hoping to get only the A records from a dns zone file so > >the expression I used is: > > > >egrep [[:space:]IN[:space:]A[:space:]] zone_file >h0 > > > > Had it worked, all that would have appeared in the h0 file was > >all the A or Address records. Instead, I get those plus almost > >everything else in the file. > try: > > egrep "IN[^[:alnum:]]+A" zone_file For even finer results, use word boundaries ... egrep '\bIN[^[:alnum:]]+A\b' file egrep '\' file - Parv --