[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] IGNORECASE and split()
From: |
Wolfgang Laun |
Subject: |
Re: [bug-gawk] IGNORECASE and split() |
Date: |
Fri, 20 Sep 2019 11:53:51 +0200 |
The value of IGNORECASE [...] does not affect field splitting when using *a
single-character field separator.*
A character string of length one is a "single character", but a regular
expression ("/.../") containing a single character is not.
-W
On Fri, 20 Sep 2019 at 05:55, Peng Yu <address@hidden> wrote:
> Hi,
>
> IGNORECASE changes the behavior of split() inconsistently. Why is it
> so? Should it be consistent?
>
> awk -v IGNORECASE=1 -e 'BEGIN { n = split("abc", a, "B"); print n }' #
> I'd expect the result be 2 here.
> 1
> awk -v IGNORECASE=1 -e 'BEGIN { n = split("abc", a, /B/); print n }'
> 2
>
> --
> Regards,
> Peng
>
>