in reply to Re: finding position of first occurence of 3 different stopping criteria
in thread finding position of first occurence of 3 different stopping criteria

If you just want the position of the start of match, then it's as easy as:
print "Matched at $-[1]\n" if $text =~ /^.*?($end1|$end2|$end3)/;
See perlvar for @- and @+ variables.

Update: and this is along the same lines as Not_a_Number's post below. sorry for the redundancy...

  • Comment on Re: Re: finding position of first occurence of 3 different stopping criteria
  • Download Code