Im using MVC with Data Annotations enabled. In my ViewModel I have a property that contains a regular expression validation rule to only allow numbers
[RegularExpression("@([0-9])", ErrorMessage = "Invalid. Must use only numbers.")]
When I submit my form the ModelState.IsValid is returning as false. When I added a breakpoint on my ModelState in the controller I saw that the StreetNumber property of the ViewModel that I decorated with the regular expression data annotation was failing (even though I entered the number 84 in the form field).
Does anyone have any ideas as to why this would still be failing. (I have verified that this property was the only one that was errounously failing).