public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) {
// FIXME (from RegexpNode.java): 1.9 should care about internal or external encoding and not kcode.
// If we have a constant regexp string or if the regexp patterns asks for caching, cache the regexp
if ((!regexp.hasKnownValue() && !options.isOnce()) || (rubyRegexp == null) || context.runtime.getKCode() != rubyRegexp.getKCode()) {
RubyString pattern = (RubyString) regexp.retrieve(context, self, currScope, currDynScope, temp);
RubyRegexp re = RubyRegexp.newRegexp(context.runtime, pattern.getByteList(), options);
re.setLiteral();
rubyRegexp = re;
}
return rubyRegexp;
}