As the title says, I'm looking for a regular expression that don't allow a user to submit the Name with characters : (colon), ; (semicolon), / (forward-slash), \ (backward-slash), * (asterisk) and . (dot)
[Required]
public string Name { get; set; }
I finally ended up with this solution thanks to great suggestions from people on this thread:
[Required]
[RegularExpression(@"^[^\\/:*;\.\)\(]+$", ErrorMessage = "The characters ':', '.' ';', '*', '/' and '\' are not allowed")]
public string Name { get; set; }