title: Regex to allow only numbers, dashes and dots
body: <p>What should be the Regex to allow a string that contains only numbers (0-9) or dashes (-) or dots (.)?</p>
  
  <p>And disallow when a string contains otherwise (like alphabets or other special characters not listed above).</p>
  
  <p>Example:
  Allowed</p>
  
  <ul>
  <li>0</li>
  <li>500-100-2.3.123</li>
  </ul>
  
  <p>Disallowed</p>
  
  <ul>
  <li>abc123</li>
  <li>500-a-c.def</li>
  <li>100*</li>
  </ul>