Re: [squid-users] Regular Expression

From: Enrico Popp <e.popp@dont-contact.us>
Date: Tue, 07 Aug 2007 15:51:35 +0200

Henrik Nordstrom wrote:

>On tor, 2007-08-02 at 11:30 +0200, Enrico Popp wrote:
>
>
>>Hello
>>
>>I have an problem with regular expression in squidGuard. I'm using the
>>following regex
>>
>>s@http://www.main.example.org/(.+)@http://www.example.org@r
>>
>>Now the problem consists that http://example.org contain no querystring
>>after this rewrite. Could you please help me to understand this regular
>>expression.
>>
>>
>
>What the above says:
>
>substitute http://www "any character" main "any character" example "any
>character" org/ "one or more characters as many as there is" with the
>string "http://www.example.org"
>
>Reservation: Not sure what the r modifier is about. Haven't seen that
>before.
>
>Regards
>Henrik
>
>
In my documentation file,
/usr/share/doc/squidguard1.2.../text/configuration.tar.bz2 i've been
reading this lines

...

  where:
     * rew and rewrite are synonymous.
     * within and outside sets an optional time constraint to the
       definition.
     * the else part refers to the time constraint.

   Time constraints on rewritegroups can be used to make these groups
   functional within or outside a given time space only; Like redirect to
   local copies within peek business hours.

   Substitution is sed style (multiple):

          s@from@to@[irR]

   where:
          from is a [62]regular expression that will be replaced with the
          string to.
          the i option makes the from part match case insensitive.
          the r option makes the redirection visible to the user with a
          [63]HTTP code 302 - Moved Temporarily (The default is to make
          Squid silently fetch the alternate URL).
          the R option makes the redirection visible to the user with a
          [64]HTTP code 301 - Moved Permanently.
...

Is this wrong?

Enrico
Received on Tue Aug 07 2007 - 08:01:19 MDT

This archive was generated by hypermail pre-2.1.9 : Sat Sep 01 2007 - 12:00:03 MDT