title: RegEx to check if a string is a number
body: <p>I have a value that I believe is a number, but the RegEx I am using to confirm that the value is a number is failing. </p>
  
  <p>I'm not sure if it's the value's fault or the RegEx's, because this RegEx worked for me in past cases.</p>
  
  <pre><code>regnumber = re.compile(r"(\d),(\d) | (\d)")
  
  print("final weight:", weight)
  
  if regnumber.search(weight):
      print("weight = an int")
  
  else:
      print("weight does not = int")
  </code></pre>
  
  <p>This bit of code produces:</p>
  
  <pre><code>final weight: 7088                   
  weight does not = int
  </code></pre>
  
  <p>Can someone explain to me either why my RegEx fails or how that isn't a number?</p>
  
  <p>Thanks.</p>