title: How to set regular expressions in cshtml razor file in asp mvc?
body: <p>i want to set Regular expression in my cshtml file, please help me how i done it? i dont want use regular expression in code first.</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
  
      &lt;div class="col-md-10"&gt;
         @Html.EditorFor(model =&gt; model.Title, new { htmlAttributes = new { @class = "form-control", placeholder = "short name", required = "required", RegularExpressionAttribute = @"^([a-zA-Z .&amp;'-]+)$" } })
         @Html.ValidationMessageFor(model =&gt; model.Title,"", new { @class = "text-danger" })
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>