title: regular expression for numeric range in python
body: <p>I need to find numeric range in the format "number-number". the number should be in the range 0-3000. so I came up with this regular expression </p>
  
  <pre><code>match = re.search(r'^[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]-[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]',sentence)
  </code></pre>
  
  <p>When I ran the program I wanted to extract only 56-900 in the sentence but the program extracted other numbers also like 2016, CLP2012 etc.. I wanted to extract only numbers that have "-" in between them. What is wrong in my pattern. </p>