I am writing a GRP feature in Libya, writing for our mobile device running Windows CE 6/7. But I have participated in this. The obvious solution to implementing case-insensitive matching patterns is to clarify all the things in uppercase (or lower) due to the character classes.
The only other thing that I can think of is transforming itself into uppercase in the pattern. / P>
Even so far away from me:
function to to upperparty (instr) - check the first letter if string.find (instr, "^% l" ) Then instr = string .upper (string.sub (instr, 1, 1)). String.sub (instr, 2) check end-remaining pattern, while 1 local A, B, str = string.find (instr , "[^ %%] (% l +)") If the breaker is not ending then str if instr = string.sub (instr, 1, a) .. string.upper (string.sub (instr, a + 1, b)) .. string.sub (instr, b + 1) end-end return instr end I hate to accept how far it took, and I now Also, I can see that there are problems with things like '%%' saved for the percentage saved.
I thought it should be a very common issue, but I know a lot about this subject Can not walk Are there any easy (or at least) ways to do this? I am starting to get mad here ... you are expecting gurus to highlight me!
any character (group 2) local P = pattern: gsub ("(% (% 2) Find an alternate '%' (group 1) after:
function case_insensitive_pattern (pattern)% (?) (.) ", Function (percent, letter) if percentage = ~" Is not or not: match ("% a") - If '%' matches, or 'letter' is not a letter, return is like "return percentage". Letter second - Then, the matching letter return string Return a case-insensitive character class. Format ("[% s% s]", axis Print: Print: P>
[xx] [yY] [zz] =% d + [oO] [rr] %% [EE] [nn] [dd]
Comments
Post a Comment