print "Matched at $-[1]\n" if $text =~ /^.*?($end1|$end2|$end3)/;