emacs-devel
[Top][All Lists]
Advanced

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

Re: grep: RE error in ^*** ADVICE-ON-FAILURE-: repetition-operator opera


From: Mattias Engdegård
Subject: Re: grep: RE error in ^*** ADVICE-ON-FAILURE-: repetition-operator operand invalid
Date: Sat, 19 Nov 2022 13:42:05 +0100

19 nov. 2022 kl. 13.26 skrev Gregory Heytings <gregory@heytings.org>:

> 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.

In other words: "^***" means "^\**", matching zero or more asterisks at the 
beginning of a line.

(And even if the three asterisks were interpreted literally, it would be bad 
style.)




reply via email to

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