import re
r = re.compile(r'hello|world')
string = 'hello world the World!!'
x = r.findall(string)
for x in x:
string = string.replace(x, 'self.' + x)
print(string)
aW1wb3J0IHJlCgoKciA9IHJlLmNvbXBpbGUocidoZWxsb3x3b3JsZCcpCgoKc3RyaW5nID0gJ2hlbGxvIHdvcmxkIHRoZSBXb3JsZCEhJwoKCnggPSByLmZpbmRhbGwoc3RyaW5nKQpmb3IgeCBpbiB4OgogICAgc3RyaW5nID0gc3RyaW5nLnJlcGxhY2UoeCwgJ3NlbGYuJyArIHgpCgpwcmludChzdHJpbmcpCg==