mhgoeschl has asked for the wisdom of the Perl Monks concerning the following question:
I'm using named capture buffers within a non-scoping repeat (?: )+ structure where the buffer status (<mybuf> defined ?) is tested by an if-then-else sequence, e.g.: /(? ... (?(<mybuf>)(?:match something)|(?<mybuf>match something else)) ... )+/. Now, I would need to reset <mybuf> (to undef or defined value) within the regexp WITHOUT consuming any character of my match target. Since testing the buffer is possible using ?(<mybuf>), I'm speculating that resetting it should also be possible at runtime ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: reset named capture buffer within regex
by tobyink (Canon) on Nov 22, 2012 at 16:28 UTC | |
by mhgoeschl (Novice) on Nov 22, 2012 at 17:11 UTC | |
Re: reset named capture buffer within regex
by LanX (Saint) on Nov 22, 2012 at 18:45 UTC | |
Re: reset named capture buffer within regex
by ColonelPanic (Friar) on Nov 23, 2012 at 11:15 UTC | |
by tobyink (Canon) on Nov 23, 2012 at 11:53 UTC |
Back to
Seekers of Perl Wisdom