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 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) 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. Continue reading...