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