bug-bash
[Top][All Lists]
Advanced

[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: Chet Ramey
Subject: Re: Regex: A case where the longest match isn't being found
Date: Fri, 27 Oct 2023 16:25:28 -0400
User-agent: Mozilla Thunderbird

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 <worley@alum.mit.edu> 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 class excluding newline and quote".


That seems right

How?  If it were right, wouldn't these produce different results?

It's not. bash-current and bash-3.2 pass the same string ("\") and
pattern ("[^']") to sh_regmatch.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]