验证IP是否合法
2010-11-18 15:49
211 查看
package check { import mx.events.ValidationResultEvent; import mx.validators.RegExpValidator; public class Check { var regExpValidator:RegExpValidator=new RegExpValidator; public function is_Ip(ip:Object):Boolean{ var result:Boolean=true; this.regExpValidator.property="text"; this.regExpValidator.source=ip; this.regExpValidator.expression="^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]{1}|0[1-9]{1}[0-9]{1}|00[1-9]{1})\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]{1}|0[1-9]{1}[0-9]{1}|00[1-9]{1}|0)\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]{1}|0[1-9]{1}[0-9]{1}|00[1-9]{1}|0)\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]{1}|0[1-9]{1}[0-9]{1}|00[1-9]{1}|0)$"; this.regExpValidator.noMatchError="格式错误"; var event:ValidationResultEvent=this.regExpValidator.validate(); if(event.type==ValidationResultEvent.INVALID){ result=false; } return result; } } }
相关文章推荐
- PHP自带方法验证邮箱、URL、IP是否合法
- js验证IP是否合法?
- PHP自带方法验证邮箱、URL、IP是否合法
- PHP自带函数验证邮箱、URL、IP是否合法
- 验证IP是否合法
- php:自带方法验证邮箱、URL、IP是否合法
- PHP自带方法验证邮箱、URL、IP是否合法
- PHP验证邮箱、URL、IP是否合法
- PHP自带方法验证邮箱、URL、IP是否合法
- 使用python 中的IPy 验证IP格式是否合法
- PHP自带方法验证邮箱、URL、IP是否合法的函数
- PHP自带方法验证邮箱、URL、IP是否合法的函数
- PHP使用函数filter_var验证IP,Email,URL是否合法
- android初学------验证带端口的ip是否合法
- 验证ip和端口号是否合法js脚本
- c# 快速验证代理IP是否有用
- android开发-验证邮箱输入是否合法
- 二.验证伪装的代理ip是否成功
- Android中利用正则表达式验证手机号是否合法
- 验证输入的邮件地址是否合法