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: Jim Meyering
Subject: Re: manpage: Potentially missing right curly brace
Date: Wed, 30 Dec 2020 08:13:44 -0800

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.



reply via email to

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