Home RegexFormat Class
RegexFormat Class
Cancel

RegexFormat Class

Namespace: Json.Schema

Inheritance: RegexFormat 🡒 Format 🡒 object

A regular-expression-based format.

Properties

NameTypeSummary
KeystringThe format key.

Constructors

RegexFormat(string key, string regex)

Creates a new Json.Schema.RegexFormat.

Declaration

1
public RegexFormat(string key, string regex)
ParameterTypeDescription
keystringThe format key.
regexstringThe regular expression.

RegexFormat(string key, Regex regex)

Creates a new Json.Schema.RegexFormat.

Declaration

1
public RegexFormat(string key, Regex regex)
ParameterTypeDescription
keystringThe format key.
regexRegexThe regular expression.

Methods

Validate(JsonNode node, out string errorMessage)

Validates an instance against a format and provides an error message.

Declaration

1
public override bool Validate(JsonNode node, out string errorMessage)
ParameterTypeDescription
nodeJsonNodeThe node to validate.
errorMessageout stringAn error message.

Returns

true if the value is a match for the regular expression; false otherwise.

Contents