mardi 5 mai 2015

String should not start with ! or = Regex Expression

I am looking for a regex which doesn't allow string to be started with either '!' or '='. Here is my code at the moment in which I have only added the code for '=' which doesn't work.

[RegularExpression("^(?!=)", ErrorMessageResourceName="Error_StringStartWith",      ErrorMessageResourceType= typeof(CommonStrings))]
public String FirstName { get; set; }

Aucun commentaire:

Enregistrer un commentaire