in reply to What is being matched?
Then use logic to do more complicated AND's and OR's on the subset of the words that matched.
Now having said that, perhaps we are answering the wrong question here? The SEC has the EDGAR (Electronic Data Gathering, Analysis, and Retrieval system) online. If you look here, main SEC filing forms site and look at EDGAR Searches, there is a button to do advanced boolean searches.The 10-K filings etc are in EDGAR, but I think there is some stuff that is missing - you would have to look. Perhaps, what you need is an LWP program that uses the EDGAR website? I don't know - just an idea.#!/usr/bin/perl -w use strict; my $text = "Mr. X is a bozo and was hired and then resigned."; #build an "OR" regex from a list of search words #add \b (boundary) in front and back, then | between my @search_words = qw(bozo hired resigned); @search_words = map{"\\b$_\\b";}@search_words; my $search_regex = join("|",@search_words); #print "search_regex is: $search_regex\n"; #debug my %matched = map{$_=>1}($text =~ m/$search_regex/gi); #match global print "This bozo resigned - thank goodness!" if ($matched{bozo} and $matched{resigned}); #prints: This bozo resigned - thank goodness!
|
|---|