I am trying to validate string should not start with some character and should not contain <>.
[Required]
[Display(Name = "First name")]
[MaxLength(50)]
[RegularExpression(@"(?=(^(?!.*[><]).*$))(?=(^(?![@\+\-=\*]).*))", ErrorMessage = "firstname"+ Constants.DisplayMessage)]
public string firstname { get; set; }
this regex is working in javascript. but it is not working in c#. I have already spent almost 1 hours on it but no result please help me.
ya also tried using (^(?!.*[><]).*$)|(^(?![@\+\-=\*]).*)
this regex.but it is not working.
I am not good at regex so please help me.