On Wed, 29 Dec 2021 12:42:24 +0000, Martin Rixham
<martin.rix...@equalexperts.com> wrote:

> I'm getting an error from the following:
>
>     [martin@fedora ~]$ expr ')' : '.*'
>     expr: syntax error: unexpected ')'
>
> There also seems to be a similar problem with:
>
>     expr '(' : '.*'

I think you need to use '+' before the offending token, at least according
to the man page:

       + TOKEN
              interpret TOKEN as a string, even if it is a
              keyword like 'match' or an operator like '/'

And indeed:

$ expr '+' ')' : '.*'
1

--
D.



Reply via email to