lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>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