Agreed we should use regex for this. Though I think I can improve on this based on what I did in the file renaming improvements.

Plus, the common bits of swapprefix and delprefix should be moved to a worker function (which given the commonality will be most of it - leaving delprefix and swapprefix to be stub calls to the worker). But too late here for me to think straight enough to do regex stuff - which makes my brain hurt on a good day!! So time for bed - and work on this tomorrow.