I need to match a number of 1-5 digits or empty string for model validation:
Model:
[RegularExpression(@"\d{0,5}", ErrorMessage = "Error")]
public string ServiceNumber { get; set; }
View:
@Html.TextBoxFor(m => m.ServiceNumber)
This doesn't let me leave out the input empty.