From owner-freebsd-questions@FreeBSD.ORG Fri Dec 9 22:59:20 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 DB2A216A42C for ; Fri, 9 Dec 2005 22:59:19 +0000 (GMT) (envelope-from glenn@antimatter.net) Received: from cobalt.antimatter.net (cobalt.antimatter.net [69.55.224.239]) by mx1.FreeBSD.org (Postfix) with ESMTP id B58DF43D53 for ; Fri, 9 Dec 2005 22:59:00 +0000 (GMT) (envelope-from glenn@antimatter.net) Received: from glenn-mobile.antimatter.net (cpe-66-91-226-109.san.res.rr.com [66.91.226.109]) (authenticated bits=0) by cobalt.antimatter.net (8.13.4/8.13.4) with ESMTP id jB9NRL3f018012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Dec 2005 15:27:21 -0800 X-MailKey: purple frogs are falling from the sky Message-Id: <6.2.3.4.2.20051209145132.025e64c0@cobalt.antimatter.net> X-Mailer: QUALCOMM Windows Eudora Version 6.2.3.4 Date: Fri, 09 Dec 2005 14:53:47 -0800 To: Martin McCormick , freebsd-questions@freebsd.org From: Glenn Dawson In-Reply-To: <200512092212.jB9MCQhn092277@dc.cis.okstate.edu> References: <200512092212.jB9MCQhn092277@dc.cis.okstate.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Cc: 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: Fri, 09 Dec 2005 22:59:20 -0000 At 02:12 PM 12/9/2005, Martin McCormick wrote: > After reading a bit about extended regular expressions and >having a few actually work correctly in sed scripts, I tried one in >egrep and it isn't working although there are no errors. > > 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. It is obviously not filtering correctly. >Plain grep produces a 0-length output file so that is not too useful >either. Putting double quotes around the RE didn't help either. > > It seems to match almost everything. > > Thanks for any good ideas. try: egrep "IN[^[:alnum:]]+A" zone_file -Glenn >Martin McCormick WB5AGZ Stillwater, OK >OSU Information Technology Department Network Operations Group >.-- -... ..... .- --. --.. >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"