[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regex: A case where the longest match isn't being found
From: |
Lawrence Velázquez |
Subject: |
Re: Regex: A case where the longest match isn't being found |
Date: |
Thu, 26 Oct 2023 20:48:27 -0400 |
User-agent: |
Cyrus-JMAP/3.9.0-alpha0-1048-g9229b632c5-fm-20231019.001-g9229b632 |
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