Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    squid regex correct syntax help for refresh_patterns

    Scheduled Pinned Locked Moved Cache/Proxy
    1 Posts 1 Posters 369 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 4
      4o4rh
      last edited by 4o4rh

      Can someone help to confirm my understanding of the regex syntax

      I think the -i is to ignore case but what about the 2nd line?
      should it have a -i in front two?

      refresh_pattern -i \.avg.com\/.*\.(bin)         4320    100%    43200   reload-into-ims
      

      In the above expression any domain with *.avg.com will be matched ignoring case

      refresh_pattern -i ([^.]+.|)avg.com/.*\.(bin) 	4320 	100% 	43200 	reload-into-ims
      

      in the above expression any domain in the form abc.avg.com or abc.xzy.avg.com will be matched ignoring case.
      but in this example abc.xyz.123.avg.com would not be matched.

      so that would mean the first expression is the most versatile to use, correct?

      --- update ---
      managed to come across www.regextester.com and found the 2nd expression was the best, but is with bugs above.
      it is correctly;

      refresh_pattern -i ([^.]+.|)avg\.com\/.*\.(bin)
      

      this means many of the refresh patterns on the forum are not ideal too. i will post my final refresh list once i finish testing them all

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.