I have a text string, similar to below example,
I have 5-6 year of experience with 2-3 years experience in Java
I have used this below regex syntax to match it,
import re
pattern = '\d{1}-\d{1} year'
[(m.start(0), m.end(0),'Experience') for m in re.finditer(pattern, string)]
# results
5-6 year
2-3 year (In this case it's missing out the 's'.)
How to modify this pattern to also match 'years and year' which every is longest?