KM is a great tool for those that are not skilled in the more complex scripting languages (of course, it is also a great tool to use with them). So, for those that might want a non-scripting KM solution, here's a (not so) simple macro.
In this case, because KM does NOT offer either of these:
I have to admit that at first this somewhat stumpted me, but then I realized that a brute-force approach of redundant replacements would work. That is why it is slower. Having said that, for small strings (< 1000 characters) the difference in speed will not be noticable by most using a modern Mac.
I was playing around with the Objective-C regular expression functions for a bit and they don't seem to recognise these metacharacters either. I may go back for another play in case I did something wrong, but I was quite surprised by this.
NSString and NSRegularExpression (which I assume KM is using behind the scenes) use ICU Regular Expressions, which AFAIK don't support the case-changing flags.