to block an url containing a regular expression use as follows in squid.conf file
eg:
acl pornblock url_regex "www.porn.com"
then block this using http_access statement
http_access deny pornblock
instead of specifying the url in the acl statement you can also specify a filename which contains a list of these url's or banned-words of regular expressions
for more info about configuring squid proxy server visit the site
www.squid-cache.org
and read the configuration manual available there.