Date: Sat, 10 Dec 2005 01:24:01 -0500 From: Parv <parv@pair.com> To: Glenn Dawson <glenn@antimatter.net> Cc: Martin McCormick <martin@dc.cis.okstate.edu>, freebsd-questions@freebsd.org Subject: Re: Regular Expression Trouble Message-ID: <20051210062401.GA9151@holestein.holy.cow> In-Reply-To: <6.2.3.4.2.20051209145132.025e64c0@cobalt.antimatter.net> References: <200512092212.jB9MCQhn092277@dc.cis.okstate.edu> <6.2.3.4.2.20051209145132.025e64c0@cobalt.antimatter.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 '\<IN[[:space:]]+A\>' file - Parv --
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051210062401.GA9151>