MCPcopy Create free account
hub / github.com/chasingboy/Xtools / select_ipv4_range

Function select_ipv4_range

utils.py:150–158  ·  view source on GitHub ↗
(view)

Source from the content-addressed store, hash-verified

148
149
150def select_ipv4_range(view):
151 pattern = r'(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)((([\-](1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])|/(1\d|2\d|3[0-2]|[1-9]))(\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d))?))'
152 regions = view.find_all(pattern)
153 ips = []
154 for region in regions:
155 text = view.substr(region)
156 ips.append(text)
157
158 return unique_sort_ipv4(ips)
159
160
161def select_ipv4_port(view):

Callers 1

runMethod · 0.85

Calls 1

unique_sort_ipv4Function · 0.85

Tested by

no test coverage detected