{ "type": "class", | |
"qname": "mx.validators.RegExpValidator", | |
"baseClassname": "mx.validators.Validator" | |
, | |
"description": "The RegExpValidator class lets you use a regular expression to validate a field. You pass a regular expression to the validator using the <code>expression</code> property, and additional flags to control the regular expression pattern matching using the <code>flags</code> property. <p>The validation is successful if the validator can find a match of the regular expression in the field to validate. A validation error occurs when the validator finds no match.</p> <p>The RegExpValidator class dispatches the <code>valid</code> and <code>invalid</code> events. For an <code>invalid</code> event, the event object is an instance of the ValidationResultEvent class, and it contains an Array of ValidationResult objects.</p> <p>However, for a <code>valid</code> event, the ValidationResultEvent object contains an Array of RegExpValidationResult objects. The RegExpValidationResult class is a child class of the ValidationResult class, and contains additional properties used with regular expressions, including the following:</p> <ul> <li><code>matchedIndex</code> An integer that contains the starting index in the input String of the match.</li> <li><code>matchedString</code> A String that contains the substring of the input String that matches the regular expression.</li> <li><code>matchedSubStrings</code> An Array of Strings that contains parenthesized substring matches, if any. If no substring matches are found, this Array is of length 0. Use matchedSubStrings[0] to access the first substring match.</li> </ul> <p>The <code><mx:RegExpValidator></code> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:</p> <pre>\\n <mx:RegExpValidator\\n expression="<i>No default</i>"\\n flags="<i>No default</i>"\\n noExpressionError="The expression is missing."\\n noMatchError="The field is invalid."\\n />\\n </pre>", | |
"tags": [ | |
{ "tagName": "includeExample", | |
"values": ["examples/RegExValidatorExample.mxml"]}, | |
{ "tagName": "see", | |
"values": ["mx.validators.RegExpValidationResult", "mx.validators.ValidationResult", "RegExp"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "mxml", | |
"values": []}, | |
{ "tagName": "productversion", | |
"values": ["Flex 3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"members": [ | |
{ "type": "method", | |
"qname": "mx.validators.RegExpValidator", | |
"namespace": "", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Constructor", | |
"tags": [ | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Flex 3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"return": "", | |
"params": []} | |
, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "String", | |
"qname": "expression", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "The regular expression to use for validation.", | |
"tags": [ | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Flex 3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "String", | |
"qname": "flags", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "The regular expression flags to use when matching.", | |
"tags": [ | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Flex 3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}] | |
} |