c# - Entity Framework Regex Mismatch -
hey guys i'm putting simple asp.net mvc form. first , last name i'm trying ensure letters a-za-z can used , minimum , maximum of 1-50 characters can used, seem have regex mismatch.
[required(errormessage = "please enter first name.")] [display(name = "first name")] [stringlength(50, minimumlength = 1, errormessage = "first name should not longer 50 characters.")] [regularexpression(@"^[a-za-z]{1, 50}$")] public string firstname { get; set; }
i have tested regex statement in few online calculators tell me corect mismatch appears when testing form.
any ideas? regex correct?
again guys tip on one. in keeping wiktor's suggestion have fixed misunderstanding regex , not typo :s have allowed non-english characters such á é etc
^[a-za-z-_ ’'‘ÆÐƎƏƐƔIJŊŒẞÞǷȜæðǝəɛɣijŋœĸſßþƿȝĄƁÇĐƊĘĦĮƘŁØƠŞȘŢȚŦŲƯy̨Ƴąɓçđɗęħįƙłøơşșţțŧųưy̨ƴÁÀÂÄǍĂĀÃÅǺĄÆǼǢƁĆĊĈČÇĎḌĐƊÐÉÈĖÊËĚĔĒĘẸƎƏƐĠĜǦĞĢƔáàâäǎăāãåǻąæǽǣɓćċĉčçďḍđɗðéèėêëěĕēęẹǝəɛġĝǧğģɣĤḤĦiÍÌİÎÏǏĬĪĨĮỊIJĴĶƘĹĻŁĽĿʼnŃn̈ŇÑŅŊÓÒÔÖǑŎŌÕŐỌØǾƠŒĥḥħıíìiîïǐĭīĩįịijĵķƙĸĺļłľŀʼnńn̈ňñņŋóòôöǒŏōõőọøǿơœŔŘŖŚŜŠŞȘṢẞŤŢṬŦÞÚÙÛÜǓŬŪŨŰŮŲỤƯẂẀŴẄǷÝỲŶŸȲỸƳŹŻŽẒŕřŗſśŝšşșṣßťţṭŧþúùûüǔŭūũűůųụưẃẁŵẅƿýỳŷÿȳỹƴźżžẓ]{1,50}$
this works perfect me :). again wiktor.
Comments
Post a Comment