yu121

ip合法性判断:

import re
def check_ip(ipAddr):
  compile_ip=re.compile(\'^(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)$\')
  if compile_ip.match(ipAddr):
    return True  
  else:  
    return False

参考:

https://www.jb51.net/article/135943.htm

分类:

技术点:

相关文章:

  • 2021-12-26
  • 2021-12-26
  • 2021-12-26
  • 2021-12-26
  • 2021-12-26
  • 2021-04-11
  • 2021-08-13
猜你喜欢
  • 2021-12-26
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-12-26
相关资源
相似解决方案