I tried the following code for digits-only validation for a contact number validation in Mvc web app.
[RegularExpression(@\"/(^\\(\\d{10})?)$/\", ErrorMessage =
This worked for me:
[RegularExpression(@"^[0-9]{10}", ErrorMessage = "Please enter proper contact details.")]