> Agh, if you go and do that, you must then be sure that rx is capable of > optimizing /a/i and /[aA]/ in the same way. What I mean is that Perl's > current regex engine is able to use /abc/i as a "constant" in a string, > while it cannot do the same for /[Aa][Bb][Cc]/. Why? Because in the > first case, the string being matched against has been folded, so "abc" > will or will not be in the string. In the second case, the string has not > been folded, so scanning for that "constant" string would > require either
Please don't use the current perl as an example. I am proposing a new algorithm for Parrot regex engine. Of course, the current Perl regex engine will not benefit from it. For things like /AbC/i, the new rx engine must be able to optimize it down to rx_opcode_ascii_match_case_insensitive "abc". If you change your example to include 1-m and m-1 case-folding chars, the current simple and fast Perl scheme will not work at all. Hong