title: C#: Min to max number of digits after a decimal
body: <p>I'm trying to do a check for a user input for the rate entered, I want to accept the value entered if it has min 2 digits to a max of 5 digits after the decimal. </p>
  
  <p>Valid Example:</p>
  
  <pre><code>*1.12
  *1.123
  *1.1234
  *1.12345
  </code></pre>
  
  <p>Not Valid:</p>
  
  <pre><code>1
  1.1
  1.123456
  </code></pre>
  
  <p>etc.</p>
  
  <p>I've been trying to get it with Regex but right now it only allows only 5 digits after the decimal nothing less nothing more. Here's the code:</p>
  
  <pre><code>//Check if the string is a double 
  bool IsDouble(string s)
  {
      var regex = new Regex(@"^\d+\.\d{5}?$");
      var check = regex.IsMatch(s);
      return check;  
  }
  </code></pre>
  
  <p>A little help would be greatly appreciated.</p>