fork download
  1. import re
  2.  
  3. def getNumbers(s):
  4. return re.findall(r'(?<![0-9])1[89][0-9]{2}(?![0-9])', s)
  5.  
  6. testbirtdays = 'ABCDEFG 01.19.1701 1801 02.18.1901 2001'
  7. print(getNumbers(testbirtdays))
Success #stdin #stdout 0.03s 9560KB
stdin
Standard input is empty
stdout
['1801', '1901']