I have a text file that I'm reading as:
with open(file,'r+') as f:
file_data = f.read()
the file_data is a long string that has the following text:
'''This file starts here dig_1 = hello\n doge ras = friend\n sox = pie\n'''
I want to search for dig_1 then get all the text after the '=' up to the new line character \n and replace it with a different text so that it is dig_1 = hello\n is now dig_1 = unknown and do the same with the others (ras = friend\n to ras = unknown and sox = pie\n to sox = unknown). Is there an easy way to do this using regex?