for (1 .. 5) { print "Match!\n" if $some_string =~ /very long regex/o; }