Variable = (
    "The sun shines, that's fine [not, for, everyone] and if it rains, it Will Be better."
    )
Variable1 = re.sub('\\[[^]]*\\]', lambda x: x.group(0).replace(',', ''),
    Variable)
Replace a string located between