Quote:
Originally Posted by Terrible
this one seems to work like a charm. the output was precise and it grepped out exactly the http links..granted there were some bogus characters attached to a few lines of the output but hey that can be dealt with.
dont wanna sound like a pain but cna u breake this line down for me so i know what each letter or section does? so i can use this to do other things.
-n switch tells Perl to execute some code line-by-line, placing each line into the
$_ variable
-e switch gives the code to run on the input
$_=~ s/^([^:]*).*(http.*akamai[^"]*).*$/\1: \2/
=~
The right argument is a search pattern, substitution, or transliteration. The left argument is what is supposed to be searched, substituted, or transliterated.
([^:]*)
This will match path of file.
\1 will give the string matched by this regular expression
(http.*akamai[^"]*)
This will match the web address.
\2 will give the string matched by this regular expression