mirror of
https://github.com/unixtensor/proxmox-ntfy.git
synced 2025-06-28 03:48:05 +00:00
Fit address check into a single regexp
This commit is contained in:
@ -23,9 +23,7 @@ class Address:
|
||||
self.address = address
|
||||
|
||||
def valid(self) -> bool:
|
||||
if re.search(r"^\d+[.]\d+[.]\d+[.]\d+", self.address):
|
||||
return True
|
||||
elif re.search(r"^(https|http)://.+$", self.address):
|
||||
if re.search(r"^\d+[.]\d+[.]\d+[.]\d+|^(https|http)://.+$", self.address):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
Reference in New Issue
Block a user