Added custom replacement function. Now supports exact searches and doesn't bail when preg_replace compliation fails.