That would contradict tye’s explanation:
Capturing in a regex imparts a performance hit because it means that a copy will be made of the string that the regex is being applied to (which makes it a worse performance hit when matching against really large strings – one of the worst cases being running a lot of little regexes with capturing against the same huge string, something a parser is likely to do).
I don’t see how what tye said would apply if perl already behaved the way I said it should.
Makeshifts last the longest.
In reply to Re^4: An optimization of last resort: eliminate capturing from your regexps
by Aristotle
in thread An optimization of last resort: eliminate capturing from your regexps
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |