Search squid archive

Re: bad regex is blocking the wrong sites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 3 Oct 2011, devadmin wrote:

heres the contents of the bad regex blacklist im using, just a single
line.

.*porn*.*

one entry. and this single entry causes all those sites/services and
more to be blocked. What am I doing wrong?

The key is: regex != fileglob.

In regular expressions, "*" means "the preceding atom repeated zero or more times", _not_ "a string of any characters". Also, "." is an atom that matches any single character (if it's used outside square brackets).

So, ".*porn*.*" means:

Zero or more of anything, followed by "por", followed by zero or more "n", followed by zero or more of anything.

If you're trying to match dot-anything-porn-anything-dot, try this:

  \.[^.]*porn[^.]*\.

which means:

A period, followed by zero or more not-periods, followed by "porn", followed by zero or more not-periods, followed by a period.

--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 jhardin@xxxxxxxxxx    FALaholic #11174     pgpk -a jhardin@xxxxxxxxxx
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  Look at the people at the top of both efforts. Linus Torvalds is a
  university graduate with a CS degree. Bill Gates is a university
  dropout who bragged about dumpster-diving and using other peoples'
  garbage code as the basis for his code. Maybe that has something to
  do with the difference in quality/security between Linux and
  Windows.                           -- anytwofiveelevenis on Y! SCOX
-----------------------------------------------------------------------
 Tomorrow: the 7th anniversary of SpaceshipOne winning the X-prize


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux