Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: offset of named capture buffer

by Anonymous Monk
on Nov 06, 2012 at 13:43 UTC ( #1002473=note: print w/ replies, xml ) Need Help??


in reply to offset of named capture buffer

See Tie::Hash::NamedCapture, http://perl5.git.perl.org/perl.git/blob/HEAD:/ext/Tie-Hash-NamedCapture/NamedCapture.xs, perlreapi, something about named_buff, http://perl5.git.perl.org/perl.git/blob?f=regcomp.c#l6468

It is possible, but not exactly easy

Comment on Re: offset of named capture buffer
Replies are listed 'Best First'.
Re^2: offset of named capture buffer
by Anonymous Monk on Nov 06, 2012 at 13:48 UTC
    esp see http://perl5.git.perl.org/perl.git/blob?f=regcomp.c#l6532
    6524 if (rx && RXp_PAREN_NAMES(rx)) { 6525 HE *he_str = hv_fetch_ent( RXp_PAREN_NAMES(rx), namesv, 0 +, 0 ); 6526 if (he_str) { 6527 IV i; 6528 SV* sv_dat=HeVAL(he_str); 6529 I32 *nums=(I32*)SvPVX(sv_dat); 6530 for ( i=0; i<SvIVX(sv_dat); i++ ) { 6531 if ((I32)(rx->nparens) >= nums[i] 6532 && rx->offs[nums[i]].start != -1 6533 && rx->offs[nums[i]].end != -1) 6534 { 6535 ret = newSVpvs(""); 6536 CALLREG_NUMBUF_FETCH(r,nums[i],ret); 6537 if (!retarray) 6538 return ret;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002473]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2016-05-02 00:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?