On Thu, Oct 26, 2023, at 7:01 PM, Greg Wooledge wrote:
> On Thu, Oct 26, 2023 at 10:50:13AM -0700, Dan Bornstein wrote:
>> I found a case where the regex evaluator doesn't seem to be finding the
>> longest possible match for a given expression. The expression works as
>> expected on an older version of Bash (3.2.57(1)-release
>> (arm64-apple-darwin22)).
>
> Bash uses the system's (libc) version of regex(3), so the difference
> you're seeing is presumably caused by the apple-darwin22 part, rather
> than the bash 3.2 part. (Or conversely, caused by the linux-gnu part
> rather than the bash 5.2 part.)
Indeed, on my macOS system *both* 3.2.57 and 5.2.15 output
$'foo\' x'
and on shbot (the Linux IRC bot used in #bash) *both* 3.2.48 and
5.2.9 output
$'foo\'
--
vq