in reply to How are regex character classes implemented?
From the 5.6.1 regcomp.c, the UTF8 classes are handled with RVs. Check out S_regclassutf8(pTHX) with the code
-Markif (!SIZE_ONLY) { SV *rv = swash_init("utf8", "", listsv, 1, 0); #ifdef DEBUGGING AV *av = newAV(); av_push(av, rv); av_push(av, listsv); rv = newRV_noinc((SV*)av); #else SvREFCNT_dec(listsv); #endif n = add_data(1,"s"); PL_regcomp_rx->data->data[n] = (void*)rv; ARG1_SET(ret, flags); ARG2_SET(ret, n); }
|
|---|