From unknown Sun Jun 22 11:38:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28857: Wrong examples in documentation? Resent-From: Andreas =?UTF-8?Q?=C3=96hr=C3=A9n?= Original-Sender: "Debbugs-submit" Resent-CC: bug-sed@gnu.org Resent-Date: Mon, 16 Oct 2017 07:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28857 X-GNU-PR-Package: sed X-GNU-PR-Keywords: To: 28857@debbugs.gnu.org X-Debbugs-Original-To: bug-sed@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.150813793327250 (code B ref -1); Mon, 16 Oct 2017 07:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Oct 2017 07:12:13 +0000 Received: from localhost ([127.0.0.1]:42340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3zZN-00075S-7v for submit@debbugs.gnu.org; Mon, 16 Oct 2017 03:12:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3sdY-0000r4-JL for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:48:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3sdS-0000Ym-JX for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:47:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52317) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3sdS-0000Ye-Fx for submit@debbugs.gnu.org; Sun, 15 Oct 2017 19:47:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3sdR-00029U-9Q for bug-sed@gnu.org; Sun, 15 Oct 2017 19:47:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3sdQ-0000Wh-00 for bug-sed@gnu.org; Sun, 15 Oct 2017 19:47:57 -0400 Received: from mail-qt0-x22a.google.com ([2607:f8b0:400d:c0d::22a]:53720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3sdP-0000VJ-Q7 for bug-sed@gnu.org; Sun, 15 Oct 2017 19:47:55 -0400 Received: by mail-qt0-x22a.google.com with SMTP id n61so28478140qte.10 for ; Sun, 15 Oct 2017 16:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=v9Y0RKexhdjPjRvbYqhIGZGBbH+H/B+GaA53ztWPFmY=; b=E6oNqZW8T4ECAYXSSgcQ4G8L1BxkcTwiWjTrJTOn9kX7k0hPGaqPinhzFH5V3BIHvH 49gPED8sPEDcqEe+1N7pKhgJGuQcPqw+JoluDtk6ZiJw291Xvgii/nG4+72D3qZvf0v5 BRKhDDF5JXWCR76MX8BxdGhR+H6nkut0h4QeWHxtcJYN1lShFJZduLOzogXCRU7FvdtA LwHBJub9J3gq154RWGbg6ifgjaXhj/216n/3uMGX7ZmrKH+/klMYOETSSCLubBZ7vvnS yPrRKIVgM7S/kl0q4KwPh/nM8+CReWhZ5Iaa6KVahWQ5Xo4/nHPUJ1dp7v21+Mzyu2bH uAVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=v9Y0RKexhdjPjRvbYqhIGZGBbH+H/B+GaA53ztWPFmY=; b=bUkeXZKoegsNcKrtDsXNOvPWR15knpsCoBFDPdayyej0V6KJLNtpoh3Zwd8EXpPaQZ mrVFXDNCjjwhwietNRR/ws0Dn+oM2GPO8Y7VOfOMniyZ7/QqzR3igiccEWosf3+Q/yly 9kytZSPbNxhJ3C2t74wBVIvDsynXhQ2iRTdjXqRNujn1lNR5SwS+56JIr3v4y6l/szvi xxh4jDySztk4xV0SM0w3J0Rznlg3NGss4gfI7Ml3tW9jfUlyTlh0TnxW3fSRtqu9lcnx IxJJJI+AnI3tlIXqt2jrYHErXrgHL3qs4aofjrTO7v+1lsqsQwoOJceTfyV5aouBagUs XrOw== X-Gm-Message-State: AMCzsaWl5ISqJeRzgIInOhtn/dzIcI87VLkOcmSuaZ0mDRD/PqXIPSFr X+f5rEymzY5gAX0pXOQUuJlfqHaTYipgdFNr1P2STg== X-Google-Smtp-Source: AOwi7QBgWN4nQSxL0K7GmNJesCeij+/ONS6qlGkTBaNr7RlQuPg5KVeJPA6KeTJSPXOpYpk6o8Z6VfnAcIp0Pb7YZNs= X-Received: by 10.37.186.203 with SMTP id a11mr5003564ybk.460.1508111273621; Sun, 15 Oct 2017 16:47:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.132.80 with HTTP; Sun, 15 Oct 2017 16:47:53 -0700 (PDT) From: Andreas =?UTF-8?Q?=C3=96hr=C3=A9n?= Date: Mon, 16 Oct 2017 01:47:53 +0200 Message-ID: Content-Type: multipart/alternative; boundary="f403043deec8befe91055b9e84f8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Mon, 16 Oct 2017 03:12:12 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --f403043deec8befe91055b9e84f8 Content-Type: text/plain; charset="UTF-8" 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/\
Hello,

I don't have any ex= perience using sed, but it looks to me as though the documentation doesn= 9;t always use the regular expression extension that is described, in its c= orresponding example. Here's an excerpt where \B and \S aren't bein= g used in their examples:

'\b'
=C2=A0=C2=A0=C2=A0=C2=A0 M= atches a word boundary; that is it matches if the character to the
=C2= =A0=C2=A0=C2=A0=C2=A0 left is a "word" character and the characte= r to the right is a
=C2=A0=C2=A0=C2=A0=C2=A0 "non-word" charac= ter, or vice-versa.

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

= '\B'
=C2=A0=C2=A0=C2=A0=C2=A0 Matches everywhere but on a word b= oundary; that is it matches if
=C2=A0=C2=A0=C2=A0=C2=A0 the character to= the left and the character to the right are either
=C2=A0=C2=A0=C2=A0= =C2=A0 both "word" characters or both "non-word" charac= ters.

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

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

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 $ echo "abc %-=3D def." | sed 's/\s/X/g'<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 abcX%-=3DXdef.
'\S'
=C2=A0=C2=A0=C2=A0=C2=A0 Matches non-whitespace charac= ters.

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

'\<'=C2=A0=C2=A0=C2=A0=C2=A0 Matches the beginning of a word.

=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ echo "abc %-=3D def.&q= uot; | sed 's/\</X/g'
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 Xabc %-=3D Xdef.



Version:
sed (GNU sed) 4= .4

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


- An= dreas

--f403043deec8befe91055b9e84f8-- From unknown Sun Jun 22 11:38:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28857: Wrong examples in documentation? Resent-From: Assaf Gordon Original-Sender: "Debbugs-submit" Resent-CC: bug-sed@gnu.org Resent-Date: Tue, 17 Oct 2017 22:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28857 X-GNU-PR-Package: sed X-GNU-PR-Keywords: To: Andreas =?UTF-8?Q?=C3=96hr=C3=A9n?= , 28857@debbugs.gnu.org Received: via spool by 28857-submit@debbugs.gnu.org id=B28857.150828103919239 (code B ref 28857); Tue, 17 Oct 2017 22:58:01 +0000 Received: (at 28857) by debbugs.gnu.org; 17 Oct 2017 22:57:19 +0000 Received: from localhost ([127.0.0.1]:46738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4anW-00050F-VK for submit@debbugs.gnu.org; Tue, 17 Oct 2017 18:57:19 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:51582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4anV-000502-El for 28857@debbugs.gnu.org; Tue, 17 Oct 2017 18:57:17 -0400 Received: by mail-io0-f172.google.com with SMTP id b186so4036997iof.8 for <28857@debbugs.gnu.org>; Tue, 17 Oct 2017 15:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=2bhPAzQ/xt0b0hTh6Vgzpjz6L/WOu0wossAAheRu7uw=; b=jePJOsoL8lsL/Dy5k1AN91X69s8AvueObJMnXOvbE0ltMFFQyTPfMVnso1SuENWP4P /35JfcV2pWtL0dgNIVY9sADmGvBKkJ6q14bBP6Eb4QXPOJf1tKLo1sHX1RH/LIXAQVS+ Ue9Rgew1u/MujmMe9tP3M3WxFw2abv/jjEX4vDcMIRunLpmH3AWk4bkku906SbHrnDjx OWxywShIyv3coTHEaxXrKcIhWB5BGtzFBex2aaoBeO2EqiSgKxEk/uy/3hotsG9Lw0Ky 3D1tr7Oxtw3fpKWn/llYRKcQc9u4q3Lr43AEewEbDVahniOsWRY3MVMu4mDCnRbHv3p+ 7MKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2bhPAzQ/xt0b0hTh6Vgzpjz6L/WOu0wossAAheRu7uw=; b=TynLWntJ+oZxHo1XFKFnkDD55ADhEKG8fzqHwDJVOmO5pUaoT/Rgh9GRBo9tW0cNmo yLiYrlPze2RX5Jkwl44k0Bg7queu4HbzgagLfwRNyXrN+rjEBTTdRywxq6uMc9yTr37J F+j8YnKcnO7xi4xx3HRXeFK7ziibxmg6qhJ/Hy/g+p15uATVNJlwn0rjj/reoW2dHpQ8 Qc01YanwkcZ51pXMSZ6FGDzexfilucAFaotF4V3sPfnSM2frIhvjRgVMyiCfBAy8L8l0 Xxar0WS5t1j8YkH3dlcrEjDKjHP8iAtLVYtLYGQfvmxP8IWUmeLIDg5Uj7MmLrcsEXTX 7wxQ== X-Gm-Message-State: AMCzsaWoEiLIuDjJoRJQpJC6XrZ7FDQiLvNU2067XH6Tjr16H80qu+GK JI97WO44LZUDKL3SFRflMMdjxdRK X-Google-Smtp-Source: AOwi7QAZeVOuzl1msxuA/BwCmMHuhjz9TqYVll8yiR6V52OsphNHD9II121G/2WfXDoQUmQWI0DdLQ== X-Received: by 10.107.16.162 with SMTP id 34mr17653935ioq.169.1508281031718; Tue, 17 Oct 2017 15:57:11 -0700 (PDT) Received: from [192.168.88.239] (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id w133sm5720936itc.7.2017.10.17.15.57.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2017 15:57:11 -0700 (PDT) References: From: Assaf Gordon Message-ID: <505e0be2-d38f-e051-b6bd-046a10c8c214@gmail.com> Date: Tue, 17 Oct 2017 16:57:10 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 09 08:06:43 2018 Received: (at control) by debbugs.gnu.org; 9 Oct 2018 12:06:43 +0000 Received: from localhost ([127.0.0.1]:41275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9qmg-00055Z-U2 for submit@debbugs.gnu.org; Tue, 09 Oct 2018 08:06:43 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:41832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9qmf-00055M-8H for control@debbugs.gnu.org; Tue, 09 Oct 2018 08:06:41 -0400 Received: by mail-io1-f52.google.com with SMTP id q4-v6so925248iob.8 for ; Tue, 09 Oct 2018 05:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=h+BX8vgemqgqfllmv2XuSHDBDyLHNM8xxAmvsWIxh1U=; b=E9JevVhBL7aU/cG1V2j0hcag+xqCwT6Rktosk4cLz4o8hE3+/e+SXMXWZDVswmaWJU urNWBMj/8pn+NCPAp8jODdZsZuFKJsyqB4z9rQTKN1IihE8TqbQ0U5im9S9i/T2UctvI +JrtTSxHBXR4LwPZn7UQZzz3J+XvSkAS97Uw4uDathOMmGLCT9pn1irq7Y8+hIM/i9zH ERsv4TNVIhY8fwhhHLoxB8zEjP/95VFKt4h/4bHu97IsPHOx99kpZusgD0utzDlkSVee FvFunRa+8dxgWApP8AzncDHg0sPFOyuPPnVBZyrh13a/x00TxLisQAGVr2GikEXaqZEJ dn0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=h+BX8vgemqgqfllmv2XuSHDBDyLHNM8xxAmvsWIxh1U=; b=rn2JPTLlqCYYwCVNxu9bzmzusfMKNOUdosveqCL1TdSfjopouXwJa/UcsWOd9CzG4F HQs2O50yTOiHszsSarh7j3ZOjiuOEWIzRIbcnJzaVW0Z01rGD33+RJsa7VXyjES+alnK 0+oy+MhMzeg8CMZ+iHbWxOu+u5aRsdY63abmyNE0MDTxGs/rNeGm8Ndp07hiy4cpHiVf ESHDfJU9aJnaexp6rNOEkiVmh8v1porroZXtR5U5JnqzgUUXNr/1CJLqq3T7+rhuawy4 /P4r5iARYalTps+E38bCUcF6wsTIuDFT6ApY6Vi/+gOKSIeH3A2rCHHiJ9Ffo1dzR/y0 YhjA== X-Gm-Message-State: ABuFfojHIvxV2r8dYd/9/xKsCW2EOZnov74ZKKpY7AZqxQpY6g8d3ryw uwctnFf42eCKlbmXTzu/Wh1QBEUL X-Google-Smtp-Source: ACcGV62GNEY3jUKAntBSyWmg7HyUw+8LAkptQQNPkLfQmVDJtZcYYz/sokPzeG4a0K8xR2ijK2BP2Q== X-Received: by 2002:a6b:6f0f:: with SMTP id k15-v6mr15810448ioc.236.1539086795286; Tue, 09 Oct 2018 05:06:35 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id l142-v6sm6184566itl.23.2018.10.09.05.06.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 05:06:33 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: Date: Tue, 9 Oct 2018 06:06:32 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 28857 fixed close 28857 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.52 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.166.52 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 28857 fixed close 28857 stop