int tuFlags = repl.flags;
int range = value.getBegin() + value.getRealSize();
Matcher matcher = pattern.matcher(value.getUnsafeBytes(), value.getBegin(), range);
DynamicScope scope = context.getCurrentScope();
if (matcher.search(value.getBegin(), range, Option.NONE) >= 0) {
repl = RubyRegexp.regsub(repl, this, matcher, context.getRuntime().getKCode().getEncoding());
RubyRegexp.updateBackRef(context, this, scope, matcher, pattern);
return subBangCommon(context, pattern, matcher, repl, tuFlags);
} else {
return scope.setBackRef(context.getRuntime().getNil());