mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-07-07 05:37:00 +00:00
optimized pattern
This commit is contained in:
parent
99c42ff2c1
commit
c5a7788394
@ -58,8 +58,7 @@ def clean_IP_with_range(ip):
|
|||||||
# Check IP with range (IPv4 only now)
|
# Check IP with range (IPv4 only now)
|
||||||
# TODO: Add IPv6 support
|
# TODO: Add IPv6 support
|
||||||
def check_IP_with_range(ip):
|
def check_IP_with_range(ip):
|
||||||
return regex_match("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|\/)){4}(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|" +
|
return regex_match("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|\/)){4}([0-9]{1,2})(,|$)", ip)
|
||||||
"18|19|20|21|22|23|24|25|26|27|28|29|30|31|32)(,|$)", ip)
|
|
||||||
|
|
||||||
# Check allowed ips list
|
# Check allowed ips list
|
||||||
def check_Allowed_IPs(ip):
|
def check_Allowed_IPs(ip):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user