linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* squid regex
@ 2005-05-12 15:14 Luca Ferrari
  2005-05-12 15:31 ` Scott Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Ferrari @ 2005-05-12 15:14 UTC (permalink / raw)
  To: linux-admin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: squid regex
  2005-05-12 15:14 squid regex Luca Ferrari
@ 2005-05-12 15:31 ` Scott Taylor
  2005-05-12 15:40   ` Luca Ferrari
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Taylor @ 2005-05-12 15:31 UTC (permalink / raw)
  To: linux-admin


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: squid regex
  2005-05-12 15:31 ` Scott Taylor
@ 2005-05-12 15:40   ` Luca Ferrari
  2005-05-12 15:45     ` Scott Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Ferrari @ 2005-05-12 15:40 UTC (permalink / raw)
  To: linux-admin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: squid regex
  2005-05-12 15:40   ` Luca Ferrari
@ 2005-05-12 15:45     ` Scott Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Taylor @ 2005-05-12 15:45 UTC (permalink / raw)
  To: linux-admin


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-12 15:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-12 15:14 squid regex Luca Ferrari
2005-05-12 15:31 ` Scott Taylor
2005-05-12 15:40   ` Luca Ferrari
2005-05-12 15:45     ` Scott Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).