c# - Why is this Regex not working on MVC unobtrusive validator? -
i have folowing regex on mvc view model (p.s. other regex`es work fine)
[required, maxlength(256)] [regularexpression(@"/(\[brand name\])/i", errormessage = "reply message <strong> must</strong> contain <strong>[brand name]</strong>")] public string replymessage { get; set; }
unless i'm misunderstanding need, regex should be:
.*(\[brand name\]).*
or in other words, character before , after, must contain "[brand name]".
Comments
Post a Comment