[squid-users] REGEX \w+\d

From: Ghassan Gharabli <sounarose_at_googlemail.com>
Date: Sun, 30 Oct 2011 22:29:28 +0200

Hello Amos,

I am trying to find and match "abc123" only, cache-1 , cdn-1 , videos-1 .

but s/([a-z]*+[0-9]*)/cdn/; is also matching words without digits!!

I want to match for example ...
http://(a1.domain.com) not (a.domain.com) so how to restrict it more !!?

        GET http://profile.ak.fbcdn.net/hprofile-ak-ash2/275314_566041174_1327573084_s.jpg
        Store lookup URL:
http://cdn.ak.fbcdn.net/hprofile-ak-ash2/275314_566041174_1327573084_s.jpg

Here is my script

(m/^http:\/\/(.*?)\.(.*?)\/(.*?)\.(jp(e?g|e|2)|gif|png|tiff?|bmp|ico|flv|wmv|3gp|mp(4|3)|exe|msi|txt|zip|on2|mar|swf|cab).*?/)
{
       @y = ($1,$2,$3,$4);
       $y[0] =~ s/((cache|cdn|videos)[-\d]*)|([a-z]*+[0-9]*)/cdn/;
       print $x . "http://" . $y[0] . "." . $y[1] . "/" . $y[2] . "."
. $y[3] . "\n";
Received on Sun Oct 30 2011 - 20:29:35 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 31 2011 - 12:00:03 MDT