Of course, another approach would be to common-case all lines before matching...
Adding this other approach to your benchmark test…
C:\>type 634253.pl
#!perl
use strict;
use warnings;
use Benchmark qw( cmpthese );
use English qw( -no_match_vars );
local $OUTPUT_RECORD_SEPARATOR = "\n";
print 'Perl version: ', $PERL_VERSION;
my $s = 'Aid bears out ' x 10_000_000;
print 'Length of string: ', length $s;
cmpthese(-1, {
'lc' => sub { lc($s) =~ m{ [aeiou][aeiou] }xmsg },
'[Aa][Aa]' => sub { $s =~ m{ [AaEeIiOoUu][AaEeIiOoUu] }xmsg },
'[Aa]{2}' => sub { $s =~ m{ [AaEeIiOoUu]{2} }xmsg },
'/i' => sub { $s =~ m{ (?i) [aeiou]{2} }xmsg },
});
exit 0;
C:\>perl 634253.pl
Perl version: v5.16.2
Length of string: 140000000
Rate lc [Aa][Aa] /i [Aa]{2}
lc 5.20/s -- -100% -100% -100%
[Aa][Aa] 2915419/s 56073120% -- -23% -25%
/i 3764119/s 72396452% 29% -- -3%
[Aa]{2} 3877869/s 74584244% 33% 3% --
C:\>perl 634253.pl
Perl version: v5.16.2
Length of string: 140000000
Rate lc [Aa]{2} /i [Aa][Aa]
lc 4.94/s -- -100% -100% -100%
[Aa]{2} 2814401/s 57019656% -- -8% -25%
/i 3044909/s 61689750% 8% -- -19%
[Aa][Aa] 3762832/s 76234868% 34% 24% --
C:\>