GNU bug report logs - #28857
Wrong examples in documentation?

Previous Next

Package: sed;

Reported by: Andreas Öhrén <andreas.ohren <at> gmail.com>

Date: Mon, 16 Oct 2017 07:13:02 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28857 in the body.
You can then email your comments to 28857 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-sed <at> gnu.org:
bug#28857; Package sed. (Mon, 16 Oct 2017 07:13:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Öhrén <andreas.ohren <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-sed <at> gnu.org. (Mon, 16 Oct 2017 07:13:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Öhrén <andreas.ohren <at> gmail.com>
To: bug-sed <at> gnu.org
Subject: Wrong examples in documentation?
Date: Mon, 16 Oct 2017 01:47:53 +0200
[Message part 1 (text/plain, inline)]
Hello,

I don't have any experience using sed, but it looks to me as though the
documentation doesn't always use the regular expression extension that is
described, in its corresponding example. Here's an excerpt where \B and \S
aren't being used in their examples:

'\b'
     Matches a word boundary; that is it matches if the character to the
     left is a "word" character and the character to the right is a
     "non-word" character, or vice-versa.

          $ echo "abc %-= def." | sed 's/\b/X/g'
          XabcX %-= XdefX.

'\B'
     Matches everywhere but on a word boundary; that is it matches if
     the character to the left and the character to the right are either
     both "word" characters or both "non-word" characters.

          $ echo "abc %-= def." | sed 's/\w/X/g'
          aXbXc X%X-X=X dXeXf.X

'\s'
     Matches whitespace characters (spaces and tabs).  Newlines embedded
     in the pattern/hold spaces will also match:

          $ echo "abc %-= def." | sed 's/\s/X/g'
          abcX%-=Xdef.

'\S'
     Matches non-whitespace characters.

          $ echo "abc %-= def." | sed 's/\w/X/g'
          XXX XXX XXXX

'\<'
     Matches the beginning of a word.

          $ echo "abc %-= def." | sed 's/\</X/g'
          Xabc %-= Xdef.



Version:
sed (GNU sed) 4.4

The documentation states "This file documents version 4.4 of GNU 'sed'".


- Andreas
[Message part 2 (text/html, inline)]

Information forwarded to bug-sed <at> gnu.org:
bug#28857; Package sed. (Tue, 17 Oct 2017 22:58:01 GMT) Full text and rfc822 format available.

Message #8 received at 28857 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Andreas Öhrén <andreas.ohren <at> gmail.com>,
 28857 <at> debbugs.gnu.org
Subject: Re: bug#28857: Wrong examples in documentation?
Date: Tue, 17 Oct 2017 16:57:10 -0600
Hello,

On 2017-10-15 05:47 PM, Andreas Öhrén wrote:
> it looks to me as though the
> documentation doesn't always use the regular expression extension that is
> described, in its corresponding example. Here's an excerpt where \B and \S
> aren't being used in their examples:

Thank you for the report.

This was already fixed in the git source-code repository (after version 
4.4 was released), but the web site was not updated to reflect the 
latest changes.

https://git.savannah.gnu.org/cgit/sed.git/commit/?id=755e9434

Since there are few more pending documentation changes,
I'll wait for them and then update the website.

I'll keep this bug report open until then.

regards,
 - assaf





Added tag(s) fixed. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 09 Oct 2018 12:07:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 28857 <at> debbugs.gnu.org and Andreas Öhrén <andreas.ohren <at> gmail.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 09 Oct 2018 12:07:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 06 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 170 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.