Date: Sun, 4 Jul 1999 21:32:22 -0400 (EDT) From: Jamie Howard <howardjp@wam.umd.edu> To: Archie Cobbs <archie@whistle.com> Cc: freebsd-hackers@FreeBSD.org, tech-userlevel@netbsd.org, tech@openbsd.org Subject: Re: Repalcement for grep(1) Message-ID: <Pine.GSO.4.10.9907042126350.23842-100000@rac9.wam.umd.edu> In-Reply-To: <199907050109.SAA51971@bubba.whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.9907042126350.23842-100000>