[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Case-insensitive gsub?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 19 Apr 2001 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