I really like your idea. I am also not convinced at all that any programming is required at all. This appears to be a "one off" modification of a file - not some sort of thing that will be regularly done.
If the user is on Windows, I would suggest Notepad+ as a freeware editor. I use TextPad which is a "pay for" program, but I think similar to NotePad+. TextPad 4 from 25 years ago implements essentially the s/regex/regex/ functionality in the edit window. I have been offered an upgrade to TextPad 8, but I haven't bothered because what I have works fine.
I suspect that some "human guided" modification of the file using a good decades old editor will get the job done faster than trying to write some general purpose program.
Update: My attention span for this is perhaps 5-10 substitutions. I do those on a "review then approve" basis. After I have seen the regex work correctly for the first 5-10 or so cases in a row, then I turn the editor free to do the rest of the file without my explicit approval for each modification. Sometimes a very weird case is missed. If so then I fix that one again manually. Of course since this is being done in an editor, you can back out of any and all changes before saving the modified file.
The OP does not present a clear spec on what is allowed and what is not allowed - there is no "spec". |