On Tue, 3 Aug 2004 12:05:10 -0700, you wrote:

>The logic I am using may be summarized like so:
>
>if(
>($textarea_line =~ m/^\s*(Exhibit\s+[\d.]+(\s*\([0-9a-zA-Z]+\))*)\s*$/i) ||
>($textarea_line =~ m/^\s*(FORM\s+10\-K)\s*$/i) ||
>($textarea_line =~ m/^\s*(FORM\s+10\-K[A-Z]*\/*[A-Z]*)$/i) ||
>($textarea_line =~ m/^\s*(FORM\s+8\-K)\s*$/i) )
>
>I was using the index function to get the position of the particular 
>heading that triggered the match:
>
>       $heading = $1;
>       $heading_offset = index($textarea, $heading);
>
>Being the rocket scientist I am, it took me all morning to figure out 
>why I was getting inaccurate results. Then I finally went back to the 
>manual and re-discovered that index returns the position of the FIRST 
>occurrence of substring within string.
>
>First occurrence doesn't help me. I need, naturally, the exact 
>occurrence (whether the fifth or the hundredth) that triggered the match.

The @+ and @- arrays should do the job. See perldoc perlvar.

-- 
Eric Amick
Columbia, MD

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to