From olli@dorifer.heim3.tu-clausthal.de  Tue Feb 10 16:46:44 1998
Received: from dorifer.heim3.tu-clausthal.de (dorifer.heim3.tu-clausthal.de [139.174.243.252])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA19483
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 10 Feb 1998 16:46:40 -0800 (PST)
          (envelope-from olli@dorifer.heim3.tu-clausthal.de)
Received: (from olli@localhost)
	by dorifer.heim3.tu-clausthal.de (8.8.8/8.8.8) id BAA21304;
	Wed, 11 Feb 1998 01:46:29 +0100 (CET)
	(envelope-from olli)
Message-Id: <199802110046.BAA21304@dorifer.heim3.tu-clausthal.de>
Date: Wed, 11 Feb 1998 01:46:29 +0100 (CET)
From: Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>
Reply-To: oliver.fromme@heim3.tu-clausthal.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: Small bug in re_format(7) manual page.
X-Send-Pr-Version: 3.2

>Number:         5708
>Category:       docs
>Synopsis:       Small bug in re_format(7) manual page.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    steve
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 10 16:50:00 PST 1998
>Closed-Date:    Sat Feb 14 14:52:24 PST 1998
>Last-Modified:  Sat Feb 14 14:52:53 PST 1998
>Originator:     Oliver Fromme
>Release:        FreeBSD 2.2-971223-SNAP i386
>Organization:
Administration Heim 3 (Technical University of Clausthal)
>Environment:

`uname -a`:
FreeBSD dorifer.heim3.tu-clausthal.de 2.2-971223-SNAP
FreeBSD 2.2-971223-SNAP #0: Sun Feb  1 16:24:13 CET 1998
olli@dorifer.heim3.tu-clausthal.de:/usr/src/sys/compile/DORIFER  i386


>Description:

According to the re_format() manual page:

       Obsolete (``basic'') regular expressions differ in several
       respects.   `|',  `+', and `?' are ordinary characters and
       there is  no  equivalent  for  their  functionality.

This is not completely correct.  `x+' is equivalent to `xx*' or
`x\{1,\}', and `x?' is equivalent to `x\{0,1\}'.
                     

>How-To-Repeat:

Enter "man 7 re_format".


>Fix:
	
--- re_format.7.orig	Wed Feb 11 01:32:32 1998
+++ re_format.7	Wed Feb 11 01:41:15 1998
@@ -222,8 +222,12 @@
 POSIX-compliant.
 .PP
 Obsolete (``basic'') regular expressions differ in several respects.
-`|', `+', and `?' are ordinary characters and there is no equivalent
-for their functionality.
+`|' is an ordinary character and there is no equivalent
+for its functionality.
+`+' and `?' are ordinary characters, and their functionality
+can be expressed using bounds (`\{1,\}' or `\{0,1\}',
+respectively).
+Also note that `x+' in modern REs is equivalent to `xx*'.
 The delimiters for bounds are `\e{' and `\e}',
 with `{' and `}' by themselves ordinary characters.
 The parentheses for nested subexpressions are `\e(' and `\e)',
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sat Feb 14 08:48:39 PST 1998 
State-Changed-Why:  
Actually the manpage is correct.  These characters are only expanded 
when REG_EXTENDED is specified in the cflags argument to regcomp(3). 

From: Steve Price <sprice@hiwaay.net>
To: freebsd-gnats-submit@freebsd.org, oliver.fromme@heim3.tu-clausthal.de
Cc:  Subject: Re: docs/5708: Small bug in re_format(7) manual page.
Date: Sat, 14 Feb 1998 10:50:02 -0600

 >Description
 >
 >      According to the re_format() manual page:
 >
 >             Obsolete (``basic'') regular expressions differ in several
 >             respects.   `|',  `+', and `?' are ordinary characters and
 >             there is  no  equivalent  for  their  functionality.
 >
 >      This is not completely correct.  `x+' is equivalent to `xx*' or
 >      `x\{1,\}', and `x?' is equivalent to `x\{0,1\}'.
 
 Actually what the manpage says is correct.  'man 3 regex' and
 you will see REG_BASIC.  If (cflags & REG_BASIC) is non-zero in a
 call regcomp(3), then the |, +, and ? characters are not expanded.
 They are only treated special when (cflags & REG_EXTENDED) is
 non-zero in a call to regcomp(3).
 
 Steve

From: Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>
To: sprice@hiwaay.net (Steve Price)
Cc: freebsd-gnats-submit@freebsd.org, oliver.fromme@heim3.tu-clausthal.de
Subject: Re: docs/5708: Small bug in re_format(7) manual page.
Date: Sat, 14 Feb 1998 18:05:28 +0100 (MET)

 Steve Price wrote:
  > >Description
  > >
  > >      According to the re_format() manual page:
  > >
  > >             Obsolete (``basic'') regular expressions differ in several
  > >             respects.   `|',  `+', and `?' are ordinary characters and
  > >             there is  no  equivalent  for  their  functionality.
  > >
  > >      This is not completely correct.  `x+' is equivalent to `xx*' or
  > >      `x\{1,\}', and `x?' is equivalent to `x\{0,1\}'.
  > 
  > Actually what the manpage says is correct.  'man 3 regex' and
  > you will see REG_BASIC.  If (cflags & REG_BASIC) is non-zero in a
  > call regcomp(3), then the |, +, and ? characters are not expanded.
  > They are only treated special when (cflags & REG_EXTENDED) is
  > non-zero in a call to regcomp(3).
 
 That is NOT the bug that I was reporting.  The manpage IS
 incorrect in saying that there is no equivalent for the
 functionality of "+" and "?" in basic REs.  I'm sorry if
 my description wasn't clear enough.
 
 "+" in extended REs is equivalent to "\{1,\}" in basic REs,
 and "?" in extended REs is equivalent to "\{0,1\}" in basic
 REs.  I think that I expressed this quite clear in the diff
 that I included with my PR.
 
 Should I re-open this with another PR, or can we get it
 fixed without that?
 
 Regards
    Oliver
 
 -- 
 Oliver Fromme, Leibnizstr. 18-61, 38678 Clausthal, Germany
 (Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)

From: Steve Price <sprice@hiwaay.net>
To: Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: docs/5708: Small bug in re_format(7) manual page.
Date: Sat, 14 Feb 1998 11:14:21 -0600

 Oliver Fromme wrote:
 > 
 > That is NOT the bug that I was reporting.  The manpage IS
 > incorrect in saying that there is no equivalent for the
 > functionality of "+" and "?" in basic REs.  I'm sorry if
 > my description wasn't clear enough.
 > 
 > "+" in extended REs is equivalent to "\{1,\}" in basic REs,
 > and "?" in extended REs is equivalent to "\{0,1\}" in basic
 > REs.  I think that I expressed this quite clear in the diff
 > that I included with my PR.
 
 Ah! <:}  I understand now.  Sorry.
 
 > Should I re-open this with another PR, or can we get it
 > fixed without that?
 
 No need for a new PR let me try to come up with a new wording
 and I will let you review it.
 
 Steve
 
 > Regards
 >    Oliver
 > 
 > --
 > Oliver Fromme, Leibnizstr. 18-61, 38678 Clausthal, Germany
 > (Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)
State-Changed-From-To: closed->open 
State-Changed-By: steve 
State-Changed-When: Sat Feb 14 09:23:40 PST 1998 
State-Changed-Why:  
I misread this intent of this PR.  The problem is indeed present. 


Responsible-Changed-From-To: freebsd-bugs->steve 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sat Feb 14 09:23:40 PST 1998 
Responsible-Changed-Why:  
I am going to fix this, since I trampled on it already. 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sat Feb 14 14:52:24 PST 1998 
State-Changed-Why:  
Fix committed to -current and -stable branches.  Thanks! 
>Unformatted:
