NetBSD Problem Report #16775

Received: (qmail 11468 invoked from network); 12 May 2002 15:17:54 -0000
Message-Id: <xofit5t1jkz.fsf@blubb.pdc.kth.se>
Date: 12 May 2002 17:17:48 +0200
From: joda@pdc.kth.se (Johan Danielsson)
Reply-To: joda@pdc.kth.se
To: gnats-bugs@gnats.netbsd.org
Subject: ed documentation is unclear regarding \< and \>

>Number:         16775
>Category:       bin
>Synopsis:       ed documentation is unclear regarding \< and \>
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 12 15:18:00 +0000 2002
>Closed-Date:    
>Last-Modified:  Sun May 12 23:41:01 +0000 2002
>Originator:     Johan Danielsson
>Release:        NetBSD 1.5ZA
>Organization:
>Environment:
	<The following information is extracted from your kernel. Please>
	<append output of "ldd", "ident" where relevant (multiple lines).>
System: NetBSD blubb.pdc.kth.se 1.5ZA NetBSD 1.5ZA (BLUBB) #410: Sat Mar 9 18:04:50 CET 2002 joda@blubb.pdc.kth.se:/usr/misc/src/netbsd/netbsd-cvs/src/sys/arch/i386/compile/BLUBB i386
Architecture: i386
Machine: i386
>Description:

The manpage for ed claims that it may support \< and \>, when in fact
our regcomp does not.

>How-To-Repeat:
>Fix:

Either implement \< and \>, or change the documentation:

--- ed.1	2002/02/08 01:21:57	1.21
+++ ed.1	2002/05/12 15:05:52
@@ -398,18 +398,6 @@
 Otherwise, it matches itself.

 .TP 8
-\fR\e\*[Lt]\fR
-Anchors the single character regular expression or subexpression
-immediately following it to the beginning of a word.
-(This may not be available)
-
-.TP 8
-\fR\e\*[Gt]\fR
-Anchors the single character regular expression or subexpression
-immediately following it to the end of a word.
-(This may not be available)
-
-.TP 8
 \fR\e(\fIre\fR\e)\fR
 Defines a subexpression
 .IR re .
>Release-Note:
>Audit-Trail:

From: woods@weird.com (Greg A. Woods)
To: joda@pdc.kth.se
Cc: gnats-bugs@gnats.netbsd.org (NetBSD GNATS submissions and followups),
	netbsd-bugs@NetBSD.ORG (NetBSD Bugs and PR posting List)
Subject: Re: bin/16775: ed documentation is unclear regarding \< and \>
Date: Sun, 12 May 2002 19:40:39 -0400 (EDT)

 [ On , May 12, 2002 at 17:17:48 (+0200), Johan Danielsson wrote: ]
 > Subject: bin/16775: ed documentation is unclear regarding \< and \>
 >
 > Either implement \< and \>, or change the documentation:

 *BSD re_format(7) talks about a different form of word anchoring
 expressions:

        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.

 ... and regcomp(3) warns:

      The implementation of word-boundary matching is a bit of a kludge, and
      bugs may lurk in combinations of word-boundary matching and anchoring.

 Perhaps for compatability's sake though we should implement \< and \>
 especially given that GNU Grep implements them, which could be important
 should a decision be made to eliminate GNU Grep from NetBSD and replace
 it with a simple implementation with a BSD-like license that uses
 regcomp(3), such as this one:

 	http://www.wam.umd.edu/~howardjp/software/grep/

 (note if such a decision is made I have a "fixed" version of the above
 in use on my systems, as well as a nearly complete non-GPL'ed fgrep....)

 The \< and \> patterns are sure a heck of a lot easier to type (and
 remember!), and according to a P1003.2-D11.2:

      (8)  Arbitrary limitations on historical extensions have been
           eliminated.  (Example:  regular expressions have been described
           so that the popular \< ...  \> extension is allowed.)

 which of course hints that the *BSD implementation of [[:<:]] is not
 only less popular, but unnecessary for standards compliance.

 -- 
 								Greg A. Woods

 +1 416 218-0098;  <gwoods@acm.org>;  <g.a.woods@ieee.org>;  <woods@robohack.ca>
 Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.