How to block URLs with Python Regex List
-
Hello,
What is the Python code behind the pfb_regex_list? In the description, I have "List of Python Regex's to block via DNSBL." I don't know which Python method is used to check if a URL is valid or not.pattern = re.compile(r'some regex') # Examples url1 = "https://someurl?param=somevalue" if pattern.match(url1): print(f"{url1} is match") else: print(f"{url1} is not match") ******************* OR ********************* if pattern.search(url1): print(f"{url1} is valid") else: print(f"{url1} is not valid")
How i can build this pattern ?
Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.