如何评估一个IP? [英] How to evaluate an IP?

查看:93
本文介绍了如何评估一个IP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确定字符串是否是IP地址?是 IPv4 还是 IPv6 ?

How can I determine if a string is an IP address? Either IPv4 or IPv6?

最少和最多的字符数是什么?

What is the least and most number of characters?

我认为这是一个正则表达式的答案.

I assume this would be a regex answer.

推荐答案

但问题并不像假设a.b.c.d那样简单...

But the question is not as simple as assuming a.b.c.d ... there are way more forms than you realised.

但是,这肯定是Google的问题吗?您几乎可以在任何使用IP的地方找到个正则表达式入门! ipv4 + regex 得分183,000!

But surely this is a Google for it question? Pretty much every regex primer you can find anywhere uses IP as an example! ipv4 + regex scores 183,000 hits!

这篇关于如何评估一个IP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆