<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0-preview1.19504.10" />

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.