bug-gnulib
[Top][All Lists]
Advanced

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

Re: "grep '\]'" warnings suggest a Gnulib DFA patch


From: Bruno Haible
Subject: Re: "grep '\]'" warnings suggest a Gnulib DFA patch
Date: Sat, 04 Jun 2022 05:08:39 +0200

Paul Eggert asked:
> So, what do you think of the idea of not warning for this particular 
> stray backslash? Proposed Gnulib patch attached, with the idea of 
> propagating this into GNU grep before its upcoming release. I haven't 
> installed this.

Warning about undefined behaviour is good.

But when I think about the thousands of people who use regular expressions
out there. How would they remember that in parentheses both should be
backslash-escaped in EREs
    \(   \)
but brackets and braces are asymmetric
    \[   ]
    \{   }
Even if the warning message you install in grep has 3 or 5 lines and goes
into all details, we are not serving the community if we force them to adhere
to asymmetric rules, where up to now they could use symmetric rules.

Bruno






reply via email to

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