Validating a name with C#, ASP.NET Core 3.1 and Regex This class validates that a name contains only letters and optionally spaces, hyphens and apostrophes.
public class NameAttribute : ValidationAttribute
{
    protected override ValidationResult IsValid(object value, ValidationContext validationContext)
    {
        if (value == null) return ValidationResult.Success;

        string name = value.ToString();
        var regex = new Regex(@&quot;^[a-zA-Z]+(?:['-][a-zA-Z\s*]+)*$&quot;);

        return regex.IsMatch(name)
            ? ValidationResult.Success
            : new ValidationResult($&quot;The name '{name}' is invalid, it should consist of only letters, and optionally spaces, apostrophes and/or hyphens.&quot;);
    }
}

One thing I wasn't sure on was the null check at the start, we've got the Required attribute if something is required and I don't want the validation to occur if the value is null. Is this an appropriate way of handling it?
From the separation of concerns perspective it seems fine that you do not want to validate against emptiness. On the other hand, one can argue that why do you treat an empty string as a valid name.
My suggestion is to create a ctor with a parameter, where the consumer of the attribute can define how should it behave in case of empty input.
public class NameAttribute : ValidationAttribute
{
    private static readonly Regex NameRegex = new Regex(@&quot;^[a-zA-Z]+(?:['-][a-zA-Z\s*]+)*$&quot;, RegexOptions.Compiled);
    private readonly bool shouldTreatEmptyAsInvalid;
    public NameAttribute(bool shouldTreatEmptyAsInvalid = true)
    {
        this.shouldTreatEmptyAsInvalid = shouldTreatEmptyAsInvalid;
    }

    protected override ValidationResult IsValid(object value, ValidationContext validationContext)
    {
        if (value == null)
            return shouldTreatEmptyAsInvalid 
                ? new ValidationResult($&quot;The name is invalid, it should not be empty.&quot;) 
                : ValidationResult.Success;

        return NameRegex.IsMatch(value.ToString())
            ? ValidationResult.Success
            : new ValidationResult($&quot;The name '{value}' is invalid, it should consist of only letters, and optionally spaces, apostrophes and/or hyphens.&quot;);
    }
}

I moved the creation of the Regex to a static variable, but you should take some measurements in order to be sure, which has the best performance. Please check this MSDN article for other alternatives.