Hey Stephen, RegExps are always going to be slower than a basic indexOf, so perhaps when you loop through the names you could try running an indexOf first, then if it comes out positive, only then do you the RegExp replacement.
I imagine that there would be a cutoff point where the performance increase would or would not be apparent. Glad to help! :D