字符匹配
re.searh(r'\d\d\d.\d\d\d.\d\d\d.\d\d\d','192.168.100.124') 是search,少个字母c import rea=re.search(r'\d\d\d.\d\d\d.\d\d\d.\d\d\d','192.168.100.124')
print(a.group())
search拼错了
IP地址不能这样找的吧,小甲鱼给出的正则匹配是这样的:
(25|2\d|\d{2}|?\d)\.(25|2\d|\d{2}|?\d)\.(25|2\d|\d{2}|?\d)\.(25|2\d|\d{2}|?\d) 谢谢 lils76 发表于 2020-9-15 10:20
谢谢
如果问题解决了,就设个最佳吧,把求助帖关了
页:
[1]