From owner-freebsd-questions@freebsd.org Mon Apr 17 16:51:55 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AF55D41C5B for ; Mon, 17 Apr 2017 16:51:55 +0000 (UTC) (envelope-from jtrigg@huiekin.org) Received: from argent.heraldsnet.org (mail.pegasuscomputing.com [69.30.240.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "pegasuscomputing.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44F661C30 for ; Mon, 17 Apr 2017 16:51:54 +0000 (UTC) (envelope-from jtrigg@huiekin.org) Received: by argent.heraldsnet.org (Postfix, from userid 80) id 978BE61827B4; Mon, 17 Apr 2017 11:44:49 -0500 (CDT) To: freebsd-questions@freebsd.org Subject: Re: awk help X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 17 Apr 2017 12:44:49 -0400 From: Jim Trigg In-Reply-To: References: <58F25A01.1060208@gmail.com> <7951DF71-5CD3-4B53-9CB4-13CAA8945983@huiekin.org> <58F4CD14.7090008@gmail.com> Message-ID: <2677c41da02c17d82fd8104382433db5@huiekin.org> X-Sender: jtrigg@huiekin.org User-Agent: Roundcube Webmail/1.2.4 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Apr 2017 16:51:55 -0000 On 2017-04-17 12:08, Andreas Perstinger wrote: > On 2017-04-17 16:11, Ernie Luzar wrote: >> When I first tested /^Address/ and /^ Hits/ produced no output. I >> changed them to /Address/ and /Hits/ and this produced output. I >> could not find any reference to the ^ sign, so I would like to know >> what is it suppose to do? > > "^" inside a regular expression is an anchor and matches the beginning > of the line. (See "man re_format" or e.g. > http://www.regular-expressions.info/anchors.html ). In the example > you've posted, the lines containing "Address" and "Hits" are indented > which means there are spaces/tabs between the beginning of the line and > these words. Thus the patterns don't match. And I misread the original message and got the wrong number of indenting spaces in my suggested patterns. Just to be pedantic, in awk the anchor is the beginning of the *record*, not the *line*. -- Jim Trigg