http://qs321.pair.com?node_id=1230709

QM has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to have a capture for the purposes of backreferences, but not returned as part of the match?

# Example @x = 'bogus firstblahjokeblahthird bogus' =~ /(first)(?:blah).*?\2(thi +rd)/; # doesn't work # @x is empty

(In fact, I suspect the above doesn't work because, while there is eventually a 2nd capture group, it hasn't captured anything before the backreference. But that isn't really the point here.)

I don't really have a specific need, but it just seems interesting to say "this capture is only for backreference, and not for returning as a capture".

-QM
--
Quantum Mechanics: The dreams stuff is made of