Using ^ to match beginning of line in Python regex

re.findall(r'^PY (\d\d\d\d)', wosrecords, flags=re.MULTILINE)

should work

Leave a Comment