Re: [squid-users] Regex Problem - Squid 3.0STABLE10
ons 2008-12-03 klockan 18:43 +1300 skrev Amos Jeffries: Is there someone with expertise in the types of regex. Who can say whether or not the pcre library is capable of seamlessly handling the old basic regex patterns as well as the pcre patterns? PCRE only hanles Perl regex, not POSIX regex (neither basic or extended). While PCRE is mostly compatible with POSIX regex there is some subtle differences in more advanced corner cases. But most probably prefer Perl regex syntax anyway.. Both better documented, more consistent and easier to type.. Regards Henrik
Re: [squid-users] Regex Problem - Squid 3.0STABLE10
Henrik K wrote: On Mon, Nov 17, 2008 at 03:00:06PM -0800, Jeff Gerard wrote: Thanks so much...I'll definitely give this a try...but... apparently I'm not sure what to do here.. Should I simply set LDFLAGS=-lpcreposix -lpcre then run my ./configure? or?? Right.. export LDFLAGS=-lpcreposix -lpcre ./configure ... And ofcourse make sure you have PCRE library installed. libpcre3-dev for debian etc.. Since it appears to simple I'm looking at making this a proper build option. Is there someone with expertise in the types of regex. Who can say whether or not the pcre library is capable of seamlessly handling the old basic regex patterns as well as the pcre patterns? If it's to be widely available then all the demo, example, and is-use patterns need to remain usable. Amos -- Please be using Current Stable Squid 2.7.STABLE5 or 3.0.STABLE10 Current Beta Squid 3.1.0.2 or 3.0.STABLE11-RC1
Re: [squid-users] Regex Problem - Squid 3.0STABLE10
On Wed, Dec 03, 2008 at 06:43:31PM +1300, Amos Jeffries wrote: Henrik K wrote: On Mon, Nov 17, 2008 at 03:00:06PM -0800, Jeff Gerard wrote: Thanks so much...I'll definitely give this a try...but... apparently I'm not sure what to do here.. Should I simply set LDFLAGS=-lpcreposix -lpcre then run my ./configure? or?? Right.. export LDFLAGS=-lpcreposix -lpcre ./configure ... And ofcourse make sure you have PCRE library installed. libpcre3-dev for debian etc.. Since it appears to simple I'm looking at making this a proper build option. Is there someone with expertise in the types of regex. Who can say whether or not the pcre library is capable of seamlessly handling the old basic regex patterns as well as the pcre patterns? If it's to be widely available then all the demo, example, and is-use patterns need to remain usable. I don't think a regex implementation can call itself regex, unless it supports the standard posix feature set. Adrian had some comment about PCRE: http://www.squid-cache.org/bugs/show_bug.cgi?id=2215#c5 You should check first if there are benefits using the native PCRE calls. Though to the user there should be no visible impact even if you start with wrapper for now, and enhance it later.
Re: [squid-users] Regex Problem - Squid 3.0STABLE10
sweet...had to compile a newer version of PCRE and do a bit of symbolic linking but got it working! Thanks! PS...I like how you set your reply-to address to squid-users :) - Original Message - From: Henrik K Date: Monday, November 17, 2008 11:25 pm Subject: Re: [squid-users] Regex Problem - Squid 3.0STABLE10 To: squid-users@squid-cache.org On Mon, Nov 17, 2008 at 03:00:06PM -0800, Jeff Gerard wrote:BR Thanks so much...I'll definitely give this a try...but... apparently I'm not sure what to do here.. Should I simply set LDFLAGS=-lpcreposix -lpcre then run my ./configure? or?? Right.. export LDFLAGS=-lpcreposix -lpcre ./configure ... And ofcourse make sure you have PCRE library installed. libpcre3-dev for debian etc.. --- Jeff Gerard
Re: [squid-users] Regex Problem - Squid 3.0STABLE10
sweet...had to compile a newer version of PCRE and do a bit of symbolic linking but got it working! Thanks! PS...I like how you set your reply-to address to squid-users :) Reply-All in the mailer. ;) Amos - Original Message - From: Henrik K Date: Monday, November 17, 2008 11:25 pm Subject: Re: [squid-users] Regex Problem - Squid 3.0STABLE10 To: squid-users@squid-cache.org On Mon, Nov 17, 2008 at 03:00:06PM -0800, Jeff Gerard wrote:BR Thanks so much...I'll definitely give this a try...but... apparently I'm not sure what to do here.. Should I simply set LDFLAGS=-lpcreposix -lpcre then run my ./configure? or?? Right.. export LDFLAGS=-lpcreposix -lpcre ./configure ... And ofcourse make sure you have PCRE library installed. libpcre3-dev for debian etc.. --- Jeff Gerard
Re: [squid-users] Regex Problem - Squid 3.0STABLE10
Thanks so much...I'll definitely give this a try...but... apparently I'm not sure what to do here.. Should I simply set LDFLAGS=-lpcreposix -lpcre then run my ./configure? or?? Sorry if it's a dumb question... - Original Message - From: Henrik K Date: Friday, November 14, 2008 11:38 pm Subject: Re: [squid-users] Regex Problem - Squid 3.0STABLE10 To: squid-users@squid-cache.org On Fri, Nov 14, 2008 at 10:00:24PM -0600, Jeff Gerard wrote:BR I have an acl that I use to block ad sites. One of the regex's that I use is: _ad_. I have discovered that I need to tweak this regex to fail when it finds the following pattern: http://something.com/path/some_ad_test.js I modified my regex as follows: _ad_(?!test) which should work as far as I can tell, however, when I reload squid, I get the following error: squid.conf line 644: acl Deny_ADs url_regex -i /etc/squid/deny_ADs aclParseRegexList: Invalid regular expression '_ad_(?!test)': Invalid preceding regular expression You are trying PERL compatible regexp. Squid doesn't support that by default, it uses the basic system library. Easiest workaround is to compile Squid with PCRE library: LDFLAGS=-lpcreposix -lpcre It may also reduce memory leaks and speed up things if you have old/badsystem regex. --- Jeff Gerard
Re: [squid-users] Regex Problem - Squid 3.0STABLE10
On Mon, Nov 17, 2008 at 03:00:06PM -0800, Jeff Gerard wrote: Thanks so much...I'll definitely give this a try...but... apparently I'm not sure what to do here.. Should I simply set LDFLAGS=-lpcreposix -lpcre then run my ./configure? or?? Right.. export LDFLAGS=-lpcreposix -lpcre ./configure ... And ofcourse make sure you have PCRE library installed. libpcre3-dev for debian etc..
[squid-users] Regex Problem - Squid 3.0STABLE10
I have an acl that I use to block ad sites. One of the regex's that I use is: _ad_. I have discovered that I need to tweak this regex to fail when it finds the following pattern: http://something.com/path/some_ad_test.js I modified my regex as follows: _ad_(?!test) which should work as far as I can tell, however, when I reload squid, I get the following error: squid.conf line 644: acl Deny_ADs url_regex -i /etc/squid/deny_ADs aclParseRegexList: Invalid regular expression '_ad_(?!test)': Invalid preceding regular expression In fact, anytime I ever try to use round brackets, I get that error. As a workaround, I used _ad_[^t] which is vague but does allow the pattern to fail the query. Any suggestions out there? Thanks in advance...
Re: [squid-users] Regex Problem - Squid 3.0STABLE10
On Fri, Nov 14, 2008 at 10:00:24PM -0600, Jeff Gerard wrote: I have an acl that I use to block ad sites. One of the regex's that I use is: _ad_. I have discovered that I need to tweak this regex to fail when it finds the following pattern: http://something.com/path/some_ad_test.js I modified my regex as follows: _ad_(?!test) which should work as far as I can tell, however, when I reload squid, I get the following error: squid.conf line 644: acl Deny_ADs url_regex -i /etc/squid/deny_ADs aclParseRegexList: Invalid regular expression '_ad_(?!test)': Invalid preceding regular expression You are trying PERL compatible regexp. Squid doesn't support that by default, it uses the basic system library. Easiest workaround is to compile Squid with PCRE library: LDFLAGS=-lpcreposix -lpcre It may also reduce memory leaks and speed up things if you have old/bad system regex.