You seem to have a nice long script and you have shown us a small code excerpt that is somewhat related, but really has nothing to do with your problem.
The problem should be either in a regular expression statement or in the code before before that statement where the hash %findReplaceH is handled and modified for use in that regex statement
Comment on Re: Remove blank space during find/replace