squid regex
am 12.05.2005 17:14:28 von Luca Ferrari
Hi,
I cannot understand a thin about squid regex: are they regex in the "unix"
meaning of the term? For example, the regex .rar will intercept only ".rar"
or everything that ends with .rar, since there is the starting dot that
catches any character?
Thanks,
Luca
--
Luca Ferrari,
fluca1978@infinito.it
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: squid regex
am 12.05.2005 17:31:40 von Scott Taylor
Luca Ferrari said:
> Hi,
> I cannot understand a thin about squid regex: are they regex in the "unix"
> meaning of the term? For example, the regex .rar will intercept only
> ".rar"
> or everything that ends with .rar, since there is the starting dot that
> catches any character?
RegEx can, and do, change with each application, however, most try to be
like Perl or C RegEx. "UNIX" RegEx also depends on the shell and program,
like grep, that you are using. So, to shorten your answer, you will need
to learn the Squid RegEx, and that may even vary in the what you are
trying to do with squid.
I have something a line like this for catching Windoze file extentions:
acl WinExecs url_regex -i \.exe \.bat \.dll \.zip \.gz \.scr \.rar \.wmv
\.mov
http_access deny WinExecs
It works pretty well. I put the \. in there so it doesn't trigger on
something like executive.html but would still trigger on
blah.executive.html
*shrug* can't protect them all from teh entire world I guess.
Maybe \.rar$ would be a better RegEx, but then what if the URL ends like
..rar?blah=blah... I'm not going to test it for you, you can do that.
Maybe that is what you are looking for?
--
Scott
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: squid regex
am 12.05.2005 17:40:04 von Luca Ferrari
On Thursday 12 May 2005 17:31 your cat walking on the keyboard wrote:
> I have something a line like this for catching Windoze file extentions:
> acl WinExecs url_regex -i \.exe \.bat \.dll \.zip \.gz \.scr \.rar \.wmv
> \.mov
> http_access deny WinExecs
>
That answers my question, thus it seems as the dot works as I said, but I was
unable to find information in the squid manual.
Thanks,
Luca
--
Luca Ferrari,
fluca1978@infinito.it
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: squid regex
am 12.05.2005 17:45:04 von Scott Taylor
Luca Ferrari said:
> On Thursday 12 May 2005 17:31 your cat walking on the keyboard wrote:
>
>> I have something a line like this for catching Windoze file extentions:
>> acl WinExecs url_regex -i \.exe \.bat \.dll \.zip \.gz \.scr \.rar \.wmv
>> \.mov
>> http_access deny WinExecs
>>
>
> That answers my question, thus it seems as the dot works as I said,
Not really as you said, it doesn't have to end in '.rar' and the '.' could
be filled with any character unless you escape it with a '\', thus '\.rar'
but will still not only end in '\.rar' unless you tell it to check the
end only by appending a '$' to the RegEx, like so '\.rar$'
Here it works mostly like RegEx in awk, sed and grep. :)
--
Scott
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html