Re: Case-insensitive gsub?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Case-insensitive gsub?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2001年4月19日 00:43:09 -0300 (EST)
>Is there any way for `gsub' to match strings without regard to case?
Not directly. But you may make do:
Change the literal parts of the pattern to be case insensitive:
Example: if the pattern is '<A HREF="(.-)">', change it to
'<[Aa] [Hh][Rr][Ee][Ff]="(.-)">'.
Very boring, but it can be automated (with a gsub on the pattern!)
I think 4.1 will allow gsub to return capture positions. In this case,
you may lowercase the target string and in the gsub function access the
original string.
--lhf