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

From: Koen Claessen <[email-masked]>
Date: Mon, 27 Mar 2023 11:14:17 +0200

Hello!

Running the command:

  echo a | grep -E -w '((()|a)|())*'

does not terminate, and uses a LOT of processor time, for all versions of
grep I have tried.

This is the smallest case that could be found; simplifying anything in the
input and/or expression leads to correct behavior.

Kind regards,
/Koen