Python下校驗一個字符串是否爲ip地址

ipv4舉例:html 利用正則表達式來匹配,python def checkip(ip): p = re.compile('^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$') if p.match(ip): return True else: retur
相關文章
相關標籤/搜索