From cec15026a2d46ac740ff50fbf70dd8df78ce984f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B8=A2=E4=BD=8E=E5=90=B8?= Date: Sat, 29 Jul 2023 20:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20=E7=A7=BB=E5=87=BA=20pattern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoBuild/tw_165.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AutoBuild/tw_165.py b/AutoBuild/tw_165.py index 366bd4e..0b61b11 100644 --- a/AutoBuild/tw_165.py +++ b/AutoBuild/tw_165.py @@ -8,11 +8,11 @@ import requests from requests.auth import HTTPBasicAuth logger = logging.getLogger(__name__) +IP_PATTERN = r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$' def is_pure_ip(domain: str) -> bool: - pattern = r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$' - return True if re.match(pattern, domain) else False + return True if re.match(IP_PATTERN, domain) else False def main():