Edit

Share via


RegexStringValidator.Validate(Object) Method

Definition

Validates a string based on the rules provided by a regular expression.

public:
 override void Validate(System::Object ^ value);
public override void Validate (object value);
override this.Validate : obj -> unit
Public Overrides Sub Validate (value As Object)

Parameters

value
Object

The value of an object.

Exceptions

value does not conform to the parameters of the Regex class.

Remarks

A RegexStringValidator object contains the rules necessary to validate a string object based on a regular expression. The rules are established when an instance of the RegexStringValidator class is created.

Instead of returning true or false, this method throws an exception if value doesn't conform to the regular expression pattern.

Applies to

See also