def meta_generator(name):
    return '//meta[@name="generator" and contains(@content, "{}")]' \
            '/@content'.format(name)

def meta_generator(name):
    return '//meta[re:test(@name,"generator","i") and contains(@content, "{}")]' \
            '/@content'.format(name)

Update meta_generator to match case insensitive