https://blog.csdn.net/zhezhebie/article/details/79097133 1.安装: composer require geoip2/geoip2:~2.0 2.用法: <?php require_once 'vendor/autoload.php'; use GeoIp2\Database\Reader; // This creates the Reader object, which should be reused across // lookups
python匹配ip正则 #!/usr/bin/env python # -*- coding:utf-8 -*- import re ip_str = "asdad1.1.1.1sdfwe2.6.5.7sdfsf2.3.94.5sdf200.198.25.0" res = [] for i in range(1): ip_t = True m_ind = 0 while ip_t: m = re.search(r"(((2([0-4]\d|5[0-5])|((1\d|[1-