I\'ve found loads of examples on to to replace text in files using regex. However it all boils down to two versions: 1. Iterate over all lines in the file and apply regex to
I'm with Bart; you really should be using some kind of parser for this.
Or, if you don't mind spawning a child process, you could just use sed (there's a native port on windows, or you can use Cygwin)