I've finally finished my new text replacing tool. I have been through god knows how many revisions and in the end I had to write 2 functions from scratch because the ones online were slow, bloated, and didn't come with whole-word checking. My text replacing tool can now check (and if necessary change) 100 items in 700 text files (and over 1 MB) in 7 seconds with a Core 2 Duo E6600. Very, very impressive. The result is that real-time changes to text are no problem at all now. And I don't need to fuck about like before doing this>
Marine>Xarine
Marin>Marlene
Xarine>Marine
Just so it doesn't accidentally change "Marine" to "Marlenee"
The new way is simply:
[W+]
Marin>Marlene
and flags stay on until they are turned off (like [W-] for whole word off].
I wrote a really clever function to get it all working and I am proud of it.
Whole word checking is not as simple as you might think because you have to take into account separators like !, ? and end lines, tabs etc...
edit.
One more revision... this time adding in checks to see if a file has been changed. If not, it doesn't get saved. This has saved another 2 seconds, so now we are down to 4 for FF7 changes.
edit 2.
and another revision...
I have added a timer to the program and status output. The total process for FF7 text files is:
1611 changes, 464 files modified, processing time 3.19 seconds. My older program did the same task in well over 10.