From owner-freebsd-hackers Sun Jul 4 18: 9:44 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bubba.whistle.com (s205m7.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 504B014DA7 for ; Sun, 4 Jul 1999 18:09:41 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.2/8.9.2) id SAA51971; Sun, 4 Jul 1999 18:09:02 -0700 (PDT) From: Archie Cobbs Message-Id: <199907050109.SAA51971@bubba.whistle.com> Subject: Re: Repalcement for grep(1) In-Reply-To: from Jamie Howard at "Jul 3, 99 03:18:07 pm" To: howardjp@wam.umd.edu (Jamie Howard) Date: Sun, 4 Jul 1999 18:09:02 -0700 (PDT) Cc: freebsd-hackers@FreeBSD.org, tech-userlevel@netbsd.org, tech@openbsd.org X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jamie Howard writes: > Now, I am having a problem though. I cannot figure out how to implement > -w and -x. For -x, I tried modifying the regular expression (foo) into > ^(foo)$ before compiling, but that did not work. I intended to do > something similar with -w. Anyway, I am probably missing the obvious, but > does anyone have any ideas regarding how I should implement -w and -x? From the re_format(7) man page: 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? -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message