From owner-freebsd-hackers Sun Jul 4 18:32:31 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from po3.wam.umd.edu (po3.wam.umd.edu [128.8.10.165]) by hub.freebsd.org (Postfix) with ESMTP id 5060714F86 for ; Sun, 4 Jul 1999 18:32:27 -0700 (PDT) (envelope-from howardjp@wam.umd.edu) Received: from rac9.wam.umd.edu (root@rac9.wam.umd.edu [128.8.10.149]) by po3.wam.umd.edu (8.9.3/8.9.3) with ESMTP id VAA29329; Sun, 4 Jul 1999 21:32:24 -0400 (EDT) Received: from rac9.wam.umd.edu (sendmail@localhost [127.0.0.1]) by rac9.wam.umd.edu (8.9.3/8.9.3) with SMTP id VAA23896; Sun, 4 Jul 1999 21:32:23 -0400 (EDT) Received: from localhost by rac9.wam.umd.edu (8.9.3/8.9.3) with ESMTP id VAA23892; Sun, 4 Jul 1999 21:32:23 -0400 (EDT) X-Authentication-Warning: rac9.wam.umd.edu: howardjp owned process doing -bs Date: Sun, 4 Jul 1999 21:32:22 -0400 (EDT) From: Jamie Howard To: Archie Cobbs Cc: freebsd-hackers@FreeBSD.org, tech-userlevel@netbsd.org, tech@openbsd.org Subject: Re: Repalcement for grep(1) In-Reply-To: <199907050109.SAA51971@bubba.whistle.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 4 Jul 1999, Archie Cobbs wrote: > There are two special cases- of bracket expressions: the > bracket expressions `[[:<:]]' and `[[:>:]]' match the null > string at the beginning and end of a word respectively. A > word is defined as a sequence of word characters which is > neither preceded nor followed by word characters. A word > character is an alnum character (as defined by ctype(3)) > or an underscore. This is an extension, compatible with > but not specified by POSIX 1003.2, and should be used with > caution in software intended to be portable to other sys- > tems. > > Perhaps this will help with -w? Yes, I received a patch from Simon Burge which implements this. It also beats using [^A-Za-z] and [A-Za-z$] as I was and GNU grep does. I am still having trouble with -x though. It turns out that even if I specify a commandline with a pattern of the form "^pattern$", it fails. If I specify "^pattern" it works. If I specify "pattern$" it does not. I have yet to find a case where my version will sucessfully match when a $ is at the end. Has anyone encountered anything like this before? Jamie To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message