in reply to Modifying a file using RegEx

You are reading from the file, changing a variable in the program, but don't write the changes back out. Typically, we open one file, make changes in memory, and then write out to a second file. At this point, we could overwrite the old with the new, or preserve both. See open.

Follow the link in the link! That is where I meant to go in the first place.

Dum Spiro Spero