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