2
Using the following Regularexpression in the Model:
[RegularExpression(@"^\d+$")]
public int ano_da_configuracao { get; set; }
I get the following result:
I tried as follows to accept only letters:
[RegularExpression(@"/^[A-ZÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/")]
thinking that it could achieve the same result, but it didn’t work.
How to fix this expression so it works as the first example?
Have you tried
[RegularExpression(@"^\w+$")]
?– Leonel Sanches da Silva
@Gypsy Morrison Mendez It didn’t work continues accepting numbers. html is like this:
data-val-regex="O campo UF deve corresponder à expressão regular '^\w+$'." data-val-regex-pattern="^\w+$"
.– Jothaz
tried to use the D?
– haykou