I'm searching a textarea that has been split into an array of lines. I'm looking for certain keywords that are centered like headings, or all by themselves on a line, right or left justified. They may also be scattered in the text within sentences, but I don't want those occurrences.

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.

Any suggestions?

-- Craig
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to