fork download
  1. import re
  2.  
  3. text = '0412020982012'
  4. rg = r'20[1-2]\d+'
  5. years = re.compile("(%s)" % (rg)).findall(text)
  6.  
  7. print(years)
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
['2020982012']