regexp on refresh_pattern

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

regexp on refresh_pattern

Heiler Bemerguy

Dudes, are these escaped characters right, for refresh_pattern syntax?

refresh_pattern -i personal\.avira\-update.com.*\.(gz|idx|lz)$ 40320 80% 120960 override-expire ignore-private ignore-no-store store-stale ignore-reload ignore-must-revalidate


-- 
Atenciosamente / Best Regards,

Heiler Bemerguy
Network Manager - CINBESA
55 91 98151-4894/3184-1751

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regexp on refresh_pattern

Amos Jeffries
Administrator
On 4/04/2017 4:24 p.m., Heiler Bemerguy wrote:
> Dudes, are these escaped characters right, for refresh_pattern syntax?
>
> *refresh_pattern -i personal\.avira\-update.com.*\.(gz|idx|lz)$ 40320
> 80% 120960 override-expire ignore-private ignore-no-store store-stale
> ignore-reload ignore-must-revalidate*
>

To which the only possible answer is:
  Are you referring to the escaped characters or the non-escaped characters?

Amos

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regexp on refresh_pattern

Heiler Bemerguy

>> Dudes, are these escaped characters right, for refresh_pattern syntax?
>>
>> *refresh_pattern -i personal\.avira\-update.com.*\.(gz|idx|lz)$ 40320
>> 80% 120960 override-expire ignore-private ignore-no-store store-stale
>> ignore-reload ignore-must-revalidate*
>>
> To which the only possible answer is:
>    Are you referring to the escaped characters or the non-escaped characters?
>

Escaped. Is it really necessary to escape dots and hyphens? And, will
the $ really makes it verify from the right to the left ?

--
Atenciosamente / Best Regards,

Heiler Bemerguy
Network Manager - CINBESA
55 91 98151-4894/3184-1751

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: regexp on refresh_pattern

Amos Jeffries
Administrator
On 5/04/2017 1:45 a.m., Heiler Bemerguy wrote:

>
>>> Dudes, are these escaped characters right, for refresh_pattern syntax?
>>>
>>> *refresh_pattern -i personal\.avira\-update.com.*\.(gz|idx|lz)$ 40320
>>> 80% 120960 override-expire ignore-private ignore-no-store store-stale
>>> ignore-reload ignore-must-revalidate*
>>>
>> To which the only possible answer is:
>>    Are you referring to the escaped characters or the non-escaped
>> characters?
>>
>
> Escaped. Is it really necessary to escape dots and hyphens?


That depends on what you want it to match. Dot (.) and hyphen (-) have
special meanings in regex, so if you want to match those exact
characters in the input, then yes you need to \-escape them.

> And, will
> the $ really makes it verify from the right to the left ?
>

Huh? never heard "verify" in regards to regex. If you mean scan, that is
something your OS regex library implementation may or may not do.

Dollar ($) is the end-anchor, the pattern is only a match if the ending
of the URL is at that position in relation to the rest of the pattern
pieces.


FYI: none of this has anything particular to do with Squid. It is basic
regular expressions. You should lookup a beginners guide to regular
expressions for these answers and many other useful things about regex.

Amos

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Loading...