|
From: | Gregory Heytings |
Subject: | Re: grep: RE error in ^*** ADVICE-ON-FAILURE-: repetition-operator operand invalid |
Date: | Sat, 19 Nov 2022 12:49:05 +0000 |
I just checked, it was not incorrect. POSIX says that in BREs the '*' is special, except wen used:- in a bracket expression - as the first character of an entire BRE (after an initial '^', if any) - as the first character of a subexpression (after an initial '^', if any)That just means that the first of the three asterisks is literal. The other two are special and indicate repetition of the literal asterisk.
Hmmm, you're correct. '^**' would be correct (matching zero or more asterisks), but '^***' is not, because POSIX also says that "multiple adjacent duplication symbols produces undefined results".
(And even if the three asterisks were interpreted literally, it would be bad style.)
It's better if the expression is correctly matched by more grep's, indeed. Anyway, bug closed.
[Prev in Thread] | Current Thread | [Next in Thread] |