Subject: Re: Repalcement for grep(1)
To: Todd Vierling , Jamie Howard <howardjp@wam.umd.edu>
From: Hannah Schroeter <uk1o@rz.uni-karlsruhe.de>
List: tech-userlevel
Date: 07/05/1999 11:47:54
Sender: tech-userlevel-owner@netbsd.org

Hello!

On Sat, Jul 03, 1999 at 05:00:41PM -0400, Todd Vierling wrote:
> [...]

> Hm.  Adding ^ and $ should work, provided you don't specify either
> REG_NOTBOL or REG_NOTEOL.  (I assume that (foo) above, including the parens,
> is the RE.  With the parens, it depends whether you're using standard REs or
> extended REs.  :)

But be careful about adding ^ and $ to something like (extended syntax)
foo|bar. ^foo|bar$ is wrong, and ^(foo|bar)$ works HERE but not always,
as when the original regex uses \number backreferences, you must patch them
(increase by one), and you're hosed if \9 is already used.

> [...]

Regards, Hannah.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message