I need to find occurrences where there is a number followed by a hyphen and another number. eg. 5-10,6-12
ExampleString ="a5-10b,48-99z, 6-12, 5-9 ,4-2"
vals = re.findall(r'(\s\d+\s?)-(\s?\d+\s?)' ,ExampleString)
I need the vals to capture 6-12, 5-9 ,4-2. I am finding it hard to capture only the numbers without the 48-99z. if I remove the question mark in the last \s? it does not capture 4-2 and if I keep it, it captures 48-99z(which I dont need)