#!/usr/bin/perl -w use strict; use Benchmark qw(cmpthese); my $i=0; sub capture { "test$i"=~/(est|\d)/; } sub noCapture { "test$i"=~/(?:est|\d)/; } sub noParens { "test$i"=~/est|\d/; } sub twoRegexen { "test$i"=~/est/ || "test$i"=~/\d/; } cmpthese(-3, { capture => \&capture, noCapture => \&noCapture, noParens => \&noParens, twoRegexen => \&twoRegexen, } );