title: How to validate input format in devextreme textbox?
body: <p>I have a textbox, and I want to validate the input.
  The acceptable format should look like this 123.908-09, but it should accept 52.232-1. This input can be null as well.</p>
  <p><em>The textbox won't accept 52.232-1</em></p>
  <p>Model</p>
  <pre><code> [RegularExpression(@&quot;([0-9]+.[0-9]+-[0-9]+)&quot;, ErrorMessage = &quot;X has an invalid format&quot;)]
   [DisplayName(&quot;X&quot;)]
   public string? x{ get; set; }
  </code></pre>
  <p>Controller</p>
  <pre><code>   [HttpPost]
      public ActionResult AddX(string values)
      {
          if (ModelState.IsValid)
          {
              _logger.LogInformation(&quot;valud values: &quot; + values);
              return View();
          }
      }
  </code></pre>
  <p>View</p>
  <pre><code>     groupItems.AddSimpleFor(m =&gt; m.x)
          .Editor(e =&gt;
                  e.TextBox()
                  .Mask(&quot;###.###-####&quot;) 
                  .MaskRules(new { X = new JS(&quot;/[02-9]/&quot;) })
                  .MaskInvalidMessage(&quot;Please follow the standard x format&quot;)
                  .UseMaskedValue(true)
                  );
  </code></pre>
  <p>Am I going in the right direction? I added the mask because, when I only added validator in model, users were able to enter letters in the textbox.</p>
  <p>Please help.</p>