Combine path replacement preg_replace calls into one
Add group functionality