Re: [squid-users] Confusion regarding regex

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 16 Jun 2010 23:11:08 +1200

GIGO . wrote:
> Hi,
>
> Please need your guidance regarding the regex used by squid. Is it bre ere or perl? I assume that squid using a gnurep compatible version? Am i right?
>

POSIX regular expressions.

>
> In grep to use some metacharacter we have to encode it which are ‘\?’, ‘\+’, ‘\{’, ‘\|’, ‘\(’, and ‘\)’ does this hold true to write regex for squid as well?
>

Yes. I know for at least these: \. \? \+ \( \)
Not sure about the others.

> acl MP3url urlpath_regex \.mp3(\?.*)?$ isnt this expression should be written as \.mp3'\(''\?'.*'\)''\?'$

No. It means the text ".mp3" ending the path (aka the MP3 file
extension), with optional query string parameters following.

Which matches URI standard syntax:
    protocol ':' '/' '/' domain '/' path '?' parameters

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.4
Received on Wed Jun 16 2010 - 11:11:16 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 21 2010 - 12:00:03 MDT