Subject: Re: bug#52873: expr unexpected syntax error

From: Davide Brini <[email-masked]>
Date: Wed, 29 Dec 2021 17:31:31 +0100

On Wed, 29 Dec 2021 12:42:24 +0000, Martin Rixham
<[email-masked]> 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.