Only apply Function and RegExps regex if there are values to replace