Subject: Re: bug#20571: sed 4.2.2
From: Jim Meyering <[email-masked]>
To: Davide Brini <[email-masked]>
Cc: [email-masked]
Date: Thu, 14 May 2015 08:05:54 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

tags 20571 notabug
thanks

On Thu, May 14, 2015 at 3:28 AM, Davide Brini <[email-masked]> wrote:
> On Thu, 14 May 2015 10:19:43 +0200 (CEST), Massimo Masotti
> <[email-masked]> wrote:
>
>> Good morning,
>>
>> the file contains "8.25F, \n". I notice a strange behavior with this line:
>>
>> sed -i -r 's/([0-9])F([,; \]\}\)])/\1\2/g'  file
>>
>> while I'm expecting to get "8.25, \n", the content is not changed. To get
>> the expected substitution, I must use:
>>
>> sed -i -r 's/([0-9])F([,; \}\)])/\1\2/g'  file
>>
>> as if it is not legal to use the escaped character  ']'.
>
> If you want to use a "]" inside a bracket expression, specify it as the
> very first character (after the ^ negation, if present, but that's not
> your case). And you don't need to escape } and ) inside the bracket
> expression, so
>
> sed -i -r 's/([0-9])F([],; })])/\1\2/g'  file
>
> Here what's inside the [] is
>
> ],; })

Thanks for helping, Davide.
Massimo, I'm marking this as "notabug" and closing the auto-filed issue.