Home > Archive > AWK > October 2004 > IGNORECASE and index()
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
IGNORECASE and index()
|
|
| Paul Boekholt 2004-10-14, 8:55 pm |
| Hello,
In the info docs for Gawk 3.1.0 it says:
If `IGNORECASE' is nonzero or non-null, then all string
comparisons and all regular expression matching are case-
independent. Thus, regexp matching with `~' and `!~', as well
as the `gensub', `gsub', `index', `match', `split', and `sub'
functions, record termination with `RS', and field splitting
with `FS', all ignore case when doing their particular regexp
operations.
I haven't tried the other operations listed here, but `index' is not
made case insensitive. Is the manual wrong, or is it a Gawk bug?
| |
| Stepan Kasal 2004-10-15, 8:55 am |
| Hello,
In article <ckc1rp$1tp$1@reader08.wxs.nl>, Paul Boekholt wrote:
> In the info docs for Gawk 3.1.0 it says:
....
> I haven't tried the other operations listed here, but `index' is not
> made case insensitive. Is the manual wrong, or is it a Gawk bug?
$ gawk 'BEGIN{IGNORECASE=1; print index("BABA", "a")}'
2
$ gawk 'BEGIN{IGNORECASE=1; print index("BaBa", "A")}'
2
$ gawk --version
GNU Awk 3.1.3
Perhaps this was a bug in 3.1.0 which was fixed in newer versions.
Stepan Kasal
|
|
|
|
|