in reply to regex capture case

In Perl 6 there's the :samecase regex modifier for a similar purpose (though it applies to substitutions and not captures). I implemented that functionality in Perl6::Str. If you don't want to use the whole module, you can still get some inspiration on how to implement such a function.