i have a regex substitution that i cannot figure out.
s2 = re.compile("^DATA_ARRAY (.*?};)", re.DOTALL|re.MULTILINE)
result = re.sub(s2, "newData", inputData)
The problem is that it replaces the "DATA_ARRAY" part as well. I need to replace only the text that comes AFTER the "DATA_ARRAY" part. I have placed the data in a group in the s2 (.*?};)
but cannot figure out how to use the re.sub function to replace only the required part.
Regards