Subject: bug#62483: echo a | grep -E -w '((()|a)|())*' # does not terminate

From: Paul Eggert <[email-masked]>
Date: Sun, 2 Apr 2023 11:29:39 -0700

On 2023-04-01 23:52, [email-masked] wrote:
> It's interesting, as gawk uses the same regex, but with different flags.

Also, GNU grep -w passes the following more-complicated regexp to dfaparse:

   (^|[^[:alnum:]_])(((()|a)|())*)([^[:alnum:]_]|$)

and quite possibly the bug is related to this extra complexity.