title: Regular expresion c# for only digits 0-9 is accepting special character \n sign
body: <p>I want to make regular expresion that will only accept string that are 4 or 6 digit long, and won`t accept any other characters.</p>
  
  <p>I have code like this:</p>
  
  <pre><code>public static bool ValidatePin(string pin)
  {
      Regex rx = new Regex(@"(^[0-9]{4}$)|(^[0-9]{6}$)");
      return rx.IsMatch(pin);
  }
  </code></pre>
  
  <p>Prety simple, but when I call:</p>
  
  <pre><code>Console.WriteLine(Kata.ValidatePin("1246\n"));
  </code></pre>
  
  <p>It returns <code>true</code>, it seems to not omit special character <code>\n</code>. What can I do to solve this problem?</p>