... push @regexes, $regex; } my $r = join '|', @regexes; $r = qr/($r)/; # compile the regex say "Regex is: $r"; # debug my $string_to_search = "djflsbcdefgkgjdslkgjabfoéabcdefg"; if ($string_to_search =~ $r) { say "Found it ($1) at position ", $-[0]; } # there is a useful magic variable @- (LAST_MATCH_START) # check perldoc for it