Is it a grinding operation? No. Regular expressions are fast, and the logic used in the example I gave you might actually use fewer CPU cycles than the logic used in your very lengthy $remove(), byte for byte comparison.
Well. At least I won lunch. Good philosophy, see good in bad, I like!