<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0-preview5.19224.8" />

RegexStringValidatorAttribute

Declaratively instructs the .NET Framework to perform string validation on a configuration property using a regular expression. This class cannot be inherited.
public string Regex { get; }

Gets the string used to perform regular-expression validation.

public RegexStringValidatorAttribute(string regex)

Initializes a new instance of the RegexStringValidatorAttribute object.