Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Dec 2005 14:53:47 -0800
From:      Glenn Dawson <glenn@antimatter.net>
To:        Martin McCormick <martin@dc.cis.okstate.edu>, freebsd-questions@freebsd.org
Subject:   Re: Regular Expression Trouble
Message-ID:  <6.2.3.4.2.20051209145132.025e64c0@cobalt.antimatter.net>
In-Reply-To: <200512092212.jB9MCQhn092277@dc.cis.okstate.edu>
References:  <200512092212.jB9MCQhn092277@dc.cis.okstate.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.2.3.4.2.20051209145132.025e64c0>