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: mrShu
Subject: Re: manpage: Potentially missing right curly brace
Date: Wed, 30 Dec 2020 17:50:37 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Thank you both for your responses.

My apologies for opening this can of worms -- thanks Paul for improving
the documentation to better reflect the situation around special and
non-special characters.

On 12/30/20 5:13 PM, Jim Meyering wrote:
> On Tue, Dec 29, 2020 at 11:24 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>> 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.
> 
> Ugh. Thank you for the correction and for documenting that ugliness.
> 
>> 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.

-- 

-- mrshu
https://shu.io



reply via email to

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