import rename = 'XYZ'value = '5'content = 'XYZ.Value = 5'print(re.sub(r'(%s\.Value\s*=\s*)([^;]+)' %name, r'\g<1>' + value, content))
Standard input is empty
XYZ.Value = 5
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!