<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.0-preview.7.25380.108" />

System.Configuration.RegexStringValidatorAttribute

Declaratively instructs .NET 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.