On 10/27/23 1:04 AM, Lawrence Velázquez wrote:
On Fri, Oct 27, 2023, at 12:25 AM, Grisha Levit wrote:
On Thu, Oct 26, 2023, 20:30 Dale R. Worley wrote:
I suspect the difference between the versions is how the regexp is
unquoted while it is being read, with version 3 interpreting [^\'] as
"cha
On Fri, Oct 27, 2023, at 12:25 AM, Grisha Levit wrote:
> On Thu, Oct 26, 2023, 20:30 Dale R. Worley wrote:
>
>> I suspect the difference between the versions is how the regexp is
>> unquoted while it is being read, with version 3 interpreting [^\'] as
>> "character class excluding newline, backsla
On Thu, Oct 26, 2023, 20:30 Dale R. Worley wrote:
> I suspect the difference between the versions is how the regexp is
> unquoted while it is being read, with version 3 interpreting [^\'] as
> "character class excluding newline, backslash, and quote" and version 5
> interpreting it as "character
Thanks to the folks who replied.
Indeed, I misunderstood the "longest match" rule to apply to captures and not
just the whole string. (That is, I thought an earlier capture would get "first
dibs" on any matching text.) And, as was pointed out by Greg W, the exact
behavior depends more on the re
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 vers
"Dan Bornstein" writes:
> 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)).
>
> Here's the regex: ^(\$\'([^\']|\\\')*\
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)).
Configuration Information [Automatically generated, do not change]:
Machine: aarch64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -ftree-vectorize -flto=auto -ffat-lto-objects -fexcepti\
ons -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY\
_SOURCE=2 -Wp,-D_GLIBCXX