Hello, I am trying to write a code to obtain certain tables (both in text and html formats) from text documents. I am having trouble obtaining the data between the 'Table' tags. Here are key pieces of my current code:
my $startstring='(<table)'; my $keywords='((Beneficially\s*Owned)|(Beneficial\s*Owners)|(Security\ +s*Ownership)|(more\s*than\s*5\spercent)|(more\s*than\s*5\%)|(more\s*t +han\s*five\s*percent)|(All\s*Directors\s*and\s*Executive\s*Officers)| +(Preferred\s*Stock))'; my $endstring='(\/table>)'; { # this step removes the default end of line character (\n) # so the the entire file can be read in at once. local $/; open (SLURP, "$direct$slash"."$file") or die "can't open $file: $!"; #read the contents into data $data = <SLURP>; } @finds=$data=~m/$keywords\s*.{0,1500}\s*($startstring.*?$endstring)/gi +sm;
The issue is is that I am obtaining matches of $keywords, etc. I want to obtain just what is inside the parentheses of my regex above. Any help would be greatly, greatly appreciated. Thanks so much.
In reply to Matching Multiple Multiple-Line Regex by kbone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |