• 请不要在回答技术问题时复制粘贴 AI 生成的内容
jianen
V2EX  ›  程序员

你能正确写出判断 IP 合法性的正则表达式吗?

  •  
  •   jianen · Dec 5, 2014 · 3440 views
    This topic created in 4219 days ago, the information mentioned may be changed or developed.
    干脆利落编写正则表达式,判断IP的合法性,需要考虑各种情况,比如下面的IP为非法:
    01.123.123.123
    0.0.0.0、255.255.255.255(保留地址)
    等等各种异常情况~~

    进阶:
    编写正则表达式判断内网ip,公网ip,非法ip。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1329 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 17:07 · PVG 01:07 · LAX 10:07 · JFK 13:07
    ♥ Do have faith in what you're doing.