I've just released version 0.5.0 of re2 which fixes an issue flagged up by Valgrind and improves the RE2::String interface to be more consistent with the Ruby standard library. As always, you can get the latest from RubyGems.org and see the full diff at https://github.com/mudge/re2/compare/v0.4.0...v0.5.0