('ab' x 3000 . 'c') =~ /.*ab.*c/; # fast if can match ('ab' x 3000) =~ /.*ab.*c/; # very very very slow if no match