title: c# regular expression only numerical characters in string
body: <p>I want to check if a string with an undefined length consist of only numbers. Example:</p>
  
  <pre><code>"234324" = true
  "er32" = false
  "1" = true
  </code></pre>
  
  <p>the way I tried to solve this problem is like this:</p>
  
  <pre><code>public bool Validate(string input)
  {
      return (Regex.IsMatch(input, @"^\d+$")) ? true : false;
  }
  </code></pre>
  
  <p>now im not a big hero with regular expressions, but according to everything I could find on the internet either the expression <code>"^\+$"</code> or <code>"^[0-9]$"</code> would work, but it doesnt :(</p>