正则表达式判断ip格式

@"^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])((\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}|(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){5})$"

兼容ip4/ip6

posted @ 2012-06-30 13:23  事理  阅读(212)  评论(0编辑  收藏  举报