匹配ip的正则表达式

if re.match(r'((25[0-5]|2[0-4]d|((1d{2})|([1-9]?d))).){3}(25[0-5]|2[0-4]d|((1d{2})|([1-9]?d)))',ip).group()==ip

原文地址:https://www.cnblogs.com/mncasey/p/11346510.html