I'm trying to match, last letter in string 'onlin' as any and then replace it if it matches with word offline. No luck. Please give advice, cheers.
import mitmproxy
import re
def response(flow):
old = b'Onlin\w{1}'
new = b'Offline'
flow.response.content = flow.response.content.replace(old, new)