Re: acl-list (ban problem)

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 03 Sep 1999 20:07:02 +0200

Roland de Greef wrote:
>
> Hi,
> I want to ban a lot of chat sites with a few lines that search the url for
> the word chat.
> The problem is if i use the line ^http://*.*chat*.*/ in an acl-ban list.
> That not only the url is processed but also the url path and that's not my
> intension. Another strange thing is that this command also blocks url with
> the word chat before the '.'.

. in a regexp is "any character".
* is 0 or more repetitions of the preceding regex "character".

A correct url_regex pattern matching what you appears to be trying to
match is something like

^http://[^.]*\.[^.]*chat

Explanation
^ = Beginning of line
http:// = the string literal "http://"
[^.]* = 0 or more of any characters except .
\. = .
[^.]* = 0 or more of any characters except .
chat = the string literal "chat"

This would match

http://www.chatline.com/
or
http://www.nochatter.net/
but not
http://chat.example.com/

A regexp matching the string "chat" anywhere in the host name would be

^http://[^/]*chat

or even simpler
acl chat dstdom_regex chat

--
Henrik Nordstrom
Spare time Squid hacker
Received on Fri Sep 03 1999 - 12:29:38 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:48:15 MST