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; } 

enter image description here

unless i'm misunderstanding need, regex should be:

.*(\[brand name\]).* 

or in other words, character before , after, must contain "[brand name]".


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -