import re
date_div = "Blah blah\n blah, Updated: Aug. 23, 2012 Blah blah Updated: Feb. 13, 2019"
up_to_word = "Updated:"
rx_to_first = r'^.*?{}' .format ( re .escape ( up_to_word) )
rx_to_last = r'^.*{}' .format ( re .escape ( up_to_word) )
print ( "Remove all up to the first occurrence of the word including it:" )
print ( re .sub ( rx_to_first, '' , date_div, flags= re .DOTALL ) .strip ( ) )
print ( "Remove all up to the last occurrence of the word including it:" )
print ( re .sub ( rx_to_last, '' , date_div, flags= re .DOTALL ) .strip ( ) )
aW1wb3J0IHJlCmRhdGVfZGl2ID0gIkJsYWggYmxhaFxuYmxhaCwgVXBkYXRlZDogQXVnLiAyMywgMjAxMiBCbGFoIGJsYWggVXBkYXRlZDogRmViLiAxMywgMjAxOSIKdXBfdG9fd29yZCA9ICJVcGRhdGVkOiIKcnhfdG9fZmlyc3QgPSByJ14uKj97fScuZm9ybWF0KHJlLmVzY2FwZSh1cF90b193b3JkKSkKcnhfdG9fbGFzdCA9IHInXi4qe30nLmZvcm1hdChyZS5lc2NhcGUodXBfdG9fd29yZCkpCnByaW50KCJSZW1vdmUgYWxsIHVwIHRvIHRoZSBmaXJzdCBvY2N1cnJlbmNlIG9mIHRoZSB3b3JkIGluY2x1ZGluZyBpdDoiKQpwcmludChyZS5zdWIocnhfdG9fZmlyc3QsICcnLCBkYXRlX2RpdiwgZmxhZ3M9cmUuRE9UQUxMKS5zdHJpcCgpKQpwcmludCgiUmVtb3ZlIGFsbCB1cCB0byB0aGUgbGFzdCBvY2N1cnJlbmNlIG9mIHRoZSB3b3JkIGluY2x1ZGluZyBpdDoiKQpwcmludChyZS5zdWIocnhfdG9fbGFzdCwgJycsIGRhdGVfZGl2LCBmbGFncz1yZS5ET1RBTEwpLnN0cmlwKCkp