[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: |
Grisha Levit |
Subject: |
Re: Regex: A case where the longest match isn't being found |
Date: |
Fri, 27 Oct 2023 00:25:01 -0400 |
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, just note that Bash is matching without the REG_NEWLINE
flag -- [[ $'\n' =~ [^x] ]] is true.
>