fork(10) download
  1. import re
  2. p = re.compile(r'^PY\s+(\d{4})', re.M)
  3. test_str = "PY123\nPY 2015\nPY 2017"
  4. print(re.findall(p, test_str))
  5.  
Success #stdin #stdout 0.01s 7692KB
stdin
Standard input is empty
stdout
['2015', '2017']