I am really bad with regexps, what I want is a regexp that does not match any html tags (for user input validation).
What I want is negative of this:
<[^>]+>
What I currently have is
public class MessageViewModel
{
[Required]
[RegularExpression(@"<[^>]+>", ErrorMessage = "No html tags allowed")]
public string UserName { get; set; }
}
but it does opposite of what I want - allows usernames only with html tags