包mx.validators
类public class RegExpValidationResult
继承RegExpValidationResult Inheritance ValidationResult Inheritance Object

RegExpValidator 类调度 valid 和 invalid 事件。对于 invalid 事件,事件对象是 ValidationResultEvent 类的实例,并且 ValidationResultEvent.results 属性包含 ValidationResult 对象的数组。

但是,对于 valid 事件,ValidationResultEvent.results 属性包含 RegExpValidationResult 对象的数组。RegExpValidationResult 类是 ValidationResult 类的子类,并且包含与正则表达式一起使用的其它属性。

另请参见

mx.events.ValidationResultEvent


公共属性
 属性定义方
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 InheritederrorCode : String
isError 属性的值为 true 时的验证错误代码。
ValidationResult
 InheritederrorMessage : String
isError 属性的值为 true 时的验证错误消息。
ValidationResult
 InheritedisError : Boolean
如果字段发生了验证错误,则包含 true。
ValidationResult
  matchedIndex : int
包含匹配项输入字符串中的起始索引的整数。
RegExpValidationResult
  matchedString : String
包含与正则表达式匹配的输入字符串的子字符串的字符串。
RegExpValidationResult
  matchedSubstrings : Array
包含用括弧括住的子字符串匹配项(如果有)的字符串数组。
RegExpValidationResult
 Inheritedprototype : Object
[静态] 对类或函数对象的原型对象的引用。
Object
 InheritedsubField : String
与结果关联的子字段的名称。
ValidationResult
公共方法
 方法定义方
  
RegExpValidationResult(isError:Boolean, subField:String = "", errorCode:String = "", errorMessage:String = "", matchedString:String = "", matchedIndex:int = 0, matchedSubstrings:Array = null)
构造函数
RegExpValidationResult
 Inherited
指示对象是否已经定义了指定的属性。
Object
 Inherited
指示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
指示指定的属性是否存在、是否可枚举。
Object
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
属性详细信息
matchedIndex属性
public var matchedIndex:int

包含匹配项输入字符串中的起始索引的整数。

matchedString属性 
public var matchedString:String

包含与正则表达式匹配的输入字符串的子字符串的字符串。

matchedSubstrings属性 
public var matchedSubstrings:Array

包含用括弧括住的子字符串匹配项(如果有)的字符串数组。如果未找到子字符串匹配项,则此数组的长度为 0。使用 matchedSubStrings[0] 访问第一个子字符串匹配项。

构造函数详细信息
RegExpValidationResult()构造函数
public function RegExpValidationResult(isError:Boolean, subField:String = "", errorCode:String = "", errorMessage:String = "", matchedString:String = "", matchedIndex:int = 0, matchedSubstrings:Array = null)

构造函数

参数
isError:Boolean — 如果存在验证错误,则传递 true。
 
subField:String (default = "") — 所验证对象的子字段的名称。
 
errorCode:String (default = "") — 验证错误代码。
 
errorMessage:String (default = "") — 验证错误消息。
 
matchedString:String (default = "") — 匹配子字符串。
 
matchedIndex:int (default = 0) — 匹配字符串的索引。
 
matchedSubstrings:Array (default = null) — 子字符串匹配项的数组。