You could approach that problem from at least two sides:
- Find a pattern that tolerates all variations, but is exact enough to exclude anything you don't want to find. Or:
- Make a hash with all possible variations as keys and check if your match exists in the hash.
The first approach might work if you can extract a common, unambigous string from all variations. For example if "Fred Joe" works as such an identifier, you could just look for
/<font.*?>(.*?Fred Joe.*?)<\/font>/ig
The second approach makes only sense when you know all variations. It could look like the following:
my %Freds = (
'Fred Joe Inc Software Company' => 1,
'Software Fred Joe Co.' => 1,
# ...
)
my @Texts = $file =~ /<font.*?>(.*?)<\/font>/ig;
foreach (@Texts) {
print $_ if $Freds{$_};
}
~Django
"Why don't we ever challenge the spherical earth theory?"
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.