Case-insensitive Lua pattern-matching
问题 I'm writing a grep utility in Lua for our mobile devices running Windows CE 6/7, but I've run into some issues implementing case-insensitive match patterns. The obvious solution of converting everything to uppercase (or lower) does not work so simply due to the character classes. The only other thing I can think of is converting the literals in the pattern itself to uppercase. Here's what I have so far: function toUpperPattern(instr) -- Check first character if string.find(instr, "^%l") then