The expression defined using DataAnnotation in the server-side code is HTML encoded when rendered as an attribute, i.e. this:
[RegularExpression(@"^[^,<>\s@]+@([^\s,@\.\[\]]+\.)*[^\s,@\.\[\]]+\.[^\s,@\.\[\]]+$", ErrorMessage = "Invalid Email")]
public string EmailAddress { get; set; }
is rendered as:
data-val-regex-pattern="^[^,<>\s@]+@([^\s,@\.\[\]]+\.)*[^\s,@\.\[\]]+\.[^\s,@\.\[\]]+$"
The result is an invalid validation expression.
Comments: We cannot repro this issue. Please see discussion for details.
[RegularExpression(@"^[^,<>\s@]+@([^\s,@\.\[\]]+\.)*[^\s,@\.\[\]]+\.[^\s,@\.\[\]]+$", ErrorMessage = "Invalid Email")]
public string EmailAddress { get; set; }
is rendered as:
data-val-regex-pattern="^[^,<>\s@]+@([^\s,@\.\[\]]+\.)*[^\s,@\.\[\]]+\.[^\s,@\.\[\]]+$"
The result is an invalid validation expression.
Comments: We cannot repro this issue. Please see discussion for details.