ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,717 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
It's about the login form where some clients must enter their email and only few others their name.
Currently I have the following:
[Required(ErrorMessageResourceName = "Validation_RequiredField", ErrorMessageResourceType = typeof(Resources))]
[RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessageResourceName = "Validation_InvalidUsername", ErrorMessageResourceType = typeof(Resources))]
public string? UserName { get; set; }
Thank you!
This worked just fine. Thx
@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*|[a-zA-Z]{4,}"