IPv4 + IPv6验证 [英] IPv4 + IPv6 validation
本文介绍了IPv4 + IPv6验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
如何验证ipv6地址表达式?可以很容易地验证IPv4,但不能使用IPv6,因为IpV6的可接受格式稍微复杂一点:1)IPv6可以包含数字和字母表,2)IPv6也有短手格式,例如:: 1。
如果有一个ipv6地址可编辑字段接受reg。表达式,数据验证不是一件容易的事。我只是想知道网上是否已经开发出任何IPv6验证码。
David N.
解决方案
^([0-9a-fA-F] {4} | 0)(\:([0-9a-fA-F] {4} | 0)){7}
Hi All,
How would you validate an ipv6 address expression? It is easy to validate IPv4, but not with IPv6, for the accepted format of IpV6 is a little more complicate: 1) IPv6 can contain both numbers and alphabets, and 2) IPv6 also has short-hand formate, for example, ::1.
If one has ipv6 address editable field that accepts reg. expression, the data validation is not an easy task. I just wonder if there is any IPv6 validation code is already developed out there on the net.
Thanks
David N.
解决方案
^([0-9a-fA-F]{4}|0)(\:([0-9a-fA-F]{4}|0)){7}
这篇关于IPv4 + IPv6验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文