grep-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: manpage: Potentially missing right curly brace


From: Paul Eggert
Subject: Re: manpage: Potentially missing right curly brace
Date: Tue, 29 Dec 2020 23:23:58 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

On 12/29/20 7:43 PM, Jim Meyering wrote:
On Tue, Dec 29, 2020 at 6:03 AM Marek Suppa <mr@shu.io> wrote:
While reviewing the way basic regular expressions are implemented in
grep, I noticed that the section where they are described in the man
page is missing the right curly brace. Unless I missed anything, this is
probably unintended, as the right curly brace is already mentioned
multiple time in the manpage as well....

Thank you for the patch. I have applied it (with minor commit-log
wording changes) and pushed here:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=181f1647f7250d3a7c104bf1d7ce4a3fafa19e3b

Unfortunately this is not quite right, as "}" is not a special character in POSIX regular expressions. For BREs, POSIX says that "grep '}'" has well-defined behavior (it matches lines with closing braces) and that the interpretation of "grep '\}'" is undefined. The situation with EREs ("grep -E") is similar.

Marek had a point that the grep documentation was not properly saying that BRE interval expressions need backslashes before both { and }. So I installed the attached patch, which attempts to fix that problem, while also being more precise about which characters are special and which (like "}") are not.

Attachment: 0001-doc-clarify-special-chars-and.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]