core/src/main/java/org/jruby/RubyRegexp.java
public final int search(ThreadContext context, RubyString str, int pos, boolean reverse) {
        int result = searchString(context, str, pos, reverse);

        // set backref for user
        context.updateBackref();

        return result;
    }
/**
     * MRI: rb_reg_search
     *
     * This version uses current thread context to hold the resulting match data.
     */
rb_reg_search
This version uses current thread context to hold the resulting match data.
rb_reg_search This version uses current thread context to hold the resulting match data .
public final int search(ThreadContext context, RubyString str, int pos, boolean reverse) {
        int result = searchString(context, str, pos, reverse);
        context.updateBackref();
        return result;
    }
public final int search ( ThreadContext context , RubyString str , int pos , boolean reverse ) { int result = searchString ( context , str , pos , reverse ) ; context . updateBackref ( ) ; return result ; }
MRI: rb_reg_search
 This version uses current thread context to hold the resulting match data.
MRI : rb_reg_search This version uses current thread context to hold the resulting match data .
// set backref for user