The RegExpValidator class dispatches the valid and invalid events. For an invalid event, the event object is an instance of the ValidationResultEvent class, and the ValidationResultEvent.results property contains an Array of ValidationResult objects.

However, for a valid event, the ValidationResultEvent.results property 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.

See also:

  • feathers.events.ValidationResultEvent

Constructor

@:value({ matchedSubstrings : null, matchedIndex : 0, matchedString : "", errorMessage : "", errorCode : "", subField : "" })new(isError:Bool, subField:String = "", errorCode:String = "", errorMessage:String = "", matchedString:String = "", matchedIndex:Int = 0, ?matchedSubstrings:Array<String>)

Constructor.

Parameters:

isError

Pass true if there was a validation error.

subField

Name of the subfield of the validated Object.

errorCode

Validation error code.

errorMessage

Validation error message.

matchedString

Matching substring.

matchedIndex

Index of the matching String.

matchedSubstrings

Array of substring matches.

Variables

matchedIndex:Int

An integer that contains the starting index in the input String of the match.

matchedString:String

A String that contains the substring of the input String that matches the regular expression.

matchedSubstrings:Array<String>

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.

Inherited Variables

Defined by ValidationResult

errorCode:String

The validation error code if the value of the isError property is true.

errorMessage:String

The validation error message if the value of the isError property is true.

isError:Bool

Contains true if the field generated a validation failure.

subField:String

The name of the subfield that the result is associated with. Some validators, such as CreditCardValidator and DateValidator, validate multiple subfields at the same time.

Inherited Methods