fakesite.com/fake-url/fake_picture.jpg
http://www.google-analytics.com/collect
http://www.fakesite.com/files-png/10453229-7.png
http://assets.pinterest.com/js/pinit.js
http://assets.pinterest.com/js/pinit_main.js
http://www.fakesite.com/files-png/10455009-1.png
http://tacoda.at.atwola.com/atx/sync/addthis/addt/default?
http://epiv.cardlytics.com/c/?pr=11018&prc=550
fakesite.com/images/fake_picture.jpg
http://www.rating-system.com/webservice/RatingService.svc/GetReviews
http://www.fakesite.com/files-png/1045997098.png
http://safebrowsing-cache.google.com/safebrowsing/rd/ChFnb29nLXBo
http://dnn506yrbagrg.cloudfront.net/pages/scripts/022/131.js?39616
####
#!/usr/bin/perl
use strict;
use warnings;
my $input_file = "/home/User/Documents/fakeDir/test_urls.txt";
my @RESULTS;
open(INPUT, "< $input_file") or die "Error: There was an error opening the input file: $!\n\n";
my $x = 0;
while ()
{
my $line = "$_";
chomp($line);
### INCLUDE STATEMENT:
if ($line =~ /^(http:\/\/)?(www\.)?fakesite.com.*/g)
{
print "CHECKING --> '$line'\n";
### EXCLUDE STATEMENT:
# *Original Regex went here instead:
# --> if ($line !~ /$ORINGAL-REGEX/g)
if ($line =~ /files-png/g)
{
print "\t\tFOUND IT....\n\n";
$RESULTS[$x] = "$line";
$x++;
} else {
print "\t\tNOT FOUND....\n\n";
}
}
}
close INPUT;
####
CHECKING --> 'fakesite.com/fake-url/fake_picture.jpg'
NOT FOUND....
CHECKING --> 'http://www.fakesite.com/files-png/10453229-7.png'
NOT FOUND....
CHECKING --> 'http://www.fakesite.com/files-png/10455009-1.png'
NOT FOUND....
CHECKING --> 'fakesite.com/images/fake_picture.jpg'
NOT FOUND....
CHECKING --> 'http://www.fakesite.com/files-png/1045997098.png'
NOT FOUND....