>>>>> "Y" == Yukihiro Matsumoto <matz / zetabits.com> writes:

Y> Has situation changed since then?

 I don't think, but I'm not really sure.

 More actually you have in the source

STATIC CHECKPOINT
S_regcppush(pTHX_ I32 parenfloor)
{
    int retval = PL_savestack_ix;
#define REGCP_PAREN_ELEMS 4
    int paren_elems_to_push = (PL_regsize - parenfloor) * REGCP_PAREN_ELEMS;
    int p;
 
#define REGCP_OTHER_ELEMS 5
    SSCHECK(paren_elems_to_push + REGCP_OTHER_ELEMS);
    for (p = PL_regsize; p > parenfloor; p--) {
/* REGCP_PARENS_ELEMS are pushed per pairs of parentheses. */
        SSPUSHINT(PL_regendp[p]);
        SSPUSHINT(PL_regstartp[p]);
        SSPUSHPTR(PL_reg_start_tmp[p]);
        SSPUSHINT(p);
    }
/* REGCP_OTHER_ELEMS are pushed in any case, parentheses or no. */
    SSPUSHINT(PL_regsize);
    SSPUSHINT(*PL_reglastparen);
    SSPUSHPTR(PL_reginput);
#define REGCP_FRAME_ELEMS 2
/* REGCP_FRAME_ELEMS are part of the REGCP_OTHER_ELEMS and
 * are needed for the regexp context stack bookkeeping. */
    SSPUSHINT(paren_elems_to_push + REGCP_OTHER_ELEMS - REGCP_FRAME_ELEMS);
    SSPUSHINT(SAVEt_REGCONTEXT); /* Magic cookie. */
 
    return retval;
}

 Perhaps you can see what is the  equivalent of this code, in the
 regexp engine of ruby :-))))


Guy Decoux